ActionController: treat different viewRenderers

This commit is contained in:
Thomas Gelf 2017-06-27 00:23:36 +02:00
parent 8f1ae6fc94
commit 74dfbcaa67
1 changed files with 11 additions and 0 deletions

View File

@ -353,6 +353,17 @@ abstract class ActionController extends Controller implements ControlsAndContent
$viewRenderer = new SimpleViewRenderer();
$viewRenderer->replaceZendViewRenderer();
$this->view = $viewRenderer->view;
} else {
$viewRenderer = null;
}
if ($this->getRequest()->isApiRequest()) {
$this->_helper->layout()->disableLayout();
if ($viewRenderer) {
$viewRenderer->disable();
} else {
$this->_helper->viewRenderer->setNoRender(true);
}
}
parent::postDispatch(); // TODO: Change the autogenerated stub