I want to use some ajax, but I don't know how to use function as the same as setNoRender() in zend framework 2 to disable for render view.
How to disable rendering view in zend framework 2?
I want to use some ajax, but I don't know how to use function as the same as setNoRender() in zend framework 2 to disable for render view.
How to disable rendering view in zend framework 2?
If you're using JSON, then look at the view's
JsonStrategy
and return aJsonModel
from you controller. See this article.Alternatively, you can return an
Response
from your controller and the whole view layer is skipped:$view = new ViewModel(); $view->setTerminate(true);
To disable your view :
"return false" disables the view and not the layout! why? because the accepted types are:
so "false" disable the view.
To disable layout and view, return a response object:
To disable layout:
Proper and simple solution to do this
Details: http://cmyker.blogspot.com/2012/11/zend-framework-2-ajax-return-json.html
I found some answer.
Though
$this->layout()->getLayout()
returns the name/path of the newly selected layout... The layout does not change with any of the following commands...within a controller
within a view PHTML file