Hello , i am performing an ACL check in my controller's initialize method and setting a layout regarding to role of authenticated user.
php public function initialize(){ $role = $this->sezon->role ? $this->sezon->role : 'visitor' ; if($this->acl->isAllowed($role,$this->dispatcher->getControllerName(),$this->dispatcher->getActionName())){ switch($role){ case "Power" : $this->view->setLayout("power"); break; case "Visitor" ; $this->view->setLayout("visitor"); break; } return true; }else{ $this->response->redirect("admin/login/"); return false; } }
This works fine controller wide , but when i try to run the code below ;
$this->view->render("somecontroller","someaction");
it renders layout twice.
P.S : i tried to disable layout at "somecontroller" with no luck.