我想用一些Ajax,但我不知道如何使用功能相同的setNoRender()Zend框架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.
如何禁用渲染视图中的Zend Framework 2?
How to disable rendering view in zend framework 2?
要禁用您的看法:
To disable your view :
public function myactionAction()
{
// your code here ...
return false;
}
返回false禁止视图,而不是布局!为什么?因为接受类型是:
"return false" disables the view and not the layout! why? because the accepted types are:
视图模型 阵列 空那么假禁用的观点。
要禁用布局和视图,返回响应对象:
To disable layout and view, return a response object:
public function myactionAction()
{
// your code here ...
return $this->response;
}
要禁止布局:
To disable layout:
public function myactionAction()
{
// your code here ...
$view = new ViewModel();
$view->setTerminal(true);
return $view;
}