How to disable zend layout from controller for ajax call only?



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

Post New Answer

More Zend Interview Questions

Does zend support php 4? Explain

1 Answers  


What should I know about the zend framework cla before submitting it?

1 Answers  


What is the difference between zend framework and laravel?

1 Answers  


What is the purpose of bootstrap in zend framework?

1 Answers  


What is zend helpers?

1 Answers  


What is the procedure to see that the optional file is detected?

1 Answers  


Explain form element decorators in zend framework2?

1 Answers  


What is event manager in zend framework?

1 Answers  


What is a module in zend framework 2?

1 Answers  


What are plugins in the zend framework?

1 Answers  


How to get variable value from getting in zend framework?

1 Answers  


Why should we use framework?

1 Answers  


Categories