Plugin Controller Ajax Request
You can't echo out of the controller function. Though, you can send back the rendered template via a convenient controller function.

$this-&gt;renderTemplate('notifications/_test');


To add variables for your template to access (because it's not automatic for security reasons). You can do this.

$this-&gt;renderTemplate('notifications/_test', array(
    'message' =&gt; $message
));