Hello, I'm not sure about the category, please change it if necessary.
For one of my actions, (IndexController::loginAction), I would like to change the layout script to more basic one than the standard admin layout and it works great with:
public function loginAction()
{
$this->view->setRenderLevel(View::LEVEL_LAYOUT)->setLayout('login');
}
Well, now I have the Security plugin, which needs to redirect the user to the login page if not logged in and works perfect with this code:
$di['dispatcher'] = function() {
//.......
$eventsManager->attach('dispatch', $adminSecurity);
//.......
return $dispatcher;
};
But the problem is - it still use the main layout and not my login layout. It seems the setRenderLevel call have no effect anymore. In the Security plugin, I'm using beforeExecuteRoute method and I've tried to change to other dispatch events. I also tried to change the event to which it is attached to dispatch:beforeDispatch with no effect.
Any help is welcome!