How to disable zend layout from controller for ajax call only?
Answer / 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 |
What is the difference between zend_auth and zend_acl?
How to install form component in zend framework?
Where is the model in zf's mvc implementation?
What do you know about zend layout?
Suppose your Zend engine supports the mode Then how can u configure your PHP Zend engine to support mode?
Write a program to show the execution of the application?
What is zend framework 2?
How to check whether a form posted or not in the zend framework?
Can we call a model in view?
What are the methods used in decorator?
What are the difference between zend_registry and zend_session?
What is the way in which the html can be used to form elements?