![]() |
|
Code snippets for symfony 1.x |
|
A simple way to detect an ajax request.
In your action class.
$this->isAjaxCall = $this->getRequest()->isXmlHttpRequest();
I put the above line in my preExecute where needed, this way the variable is accessible by action and views.
Inside a template you can use the following as well:
$sf_request->isXmlHttpRequest()