How to change layout in controller in ZendFramework2?
问题 I found this topic and answer: Change layout in the controller of Zend Framework 2.0 :: Answer I am trying to do this: public function loginAction() { if ($this->zfcUserAuthentication()->hasIdentity()) { return $this->redirect()->toRoute('zfcadmin'); } $this->layout('layout/login'); return new ViewModel(); } But it doesn't work. Sure I have file MODULE_DIR/view/layout/login.phtml . I tried to var_dump($this->layout()); before setting layout and after it and it shows, that layout is changed