How to disable zend layout from controller for ajax call only?
Answer Posted / Anjali Mishra
To disable the Zend layout for AJAX requests in your controller, you can set the response format to JSON and bypass the layout. Here's an example:
```php
$this->getResponse()->setHeader('Content-Type', 'application/json');
$this->_helper->viewRenderer->setNoRender(true);
// Your code here...
echo json_encode($result);
```
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers