I've got a custom controller in my plugin that checks whether or not the request is ajax or not, using
In the event that it is, I just want it to return a partial. First though, I'm trying to just get it to return a string but seem to be having issues getting something as simple as that to work (I'm pretty new to PHP). The code I have on the condition of it being an ajax request is:
$path = craft()->path->getSiteTemplatesPath(); craft()->path->setTemplatesPath($path); $temp = craft()->templates->render('notifications/_test'); echo $temp;
The GET request looks like this:
where the href is the controller action url.
Does anything look amiss? Am I perhaps missing a step to allow for this to work? I've tried
$allowAnonymous on the controller to no avail.