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 are the goals of zend framework?
What are the advantages of zend framework 3? Explain
What do you mean by service manager in zf2?
What is inflection?
How to fetch last inserted id, fetch all record and fetch a single record?
How to render view file from controller in zend framework?
Does zend framework support php 4?
Do you know what is the use of zend framework?
Write a program to show the execution of the application?
How to get variable's value from get?
Writing a subquery using zend db?
How to install zend on your local machine?