I am working in a website which have different units. Each unit have an own layout. The urlManager have the rule
'<unit:\w+>/<controller:\w+>/<action:\w+>/*'=>'<controller>/<action>'
and this work fine. In the view file can i use $_GET[‘unit’].
I want to set the right view in the components/Controller.php like
public $layout=$_GET['unit'];
but it seems that the urlManager hast not jet be in action at this moment …
In an action-function i can do
$this->layout=$_GET['unit'];
, but i dont want to write this code in all actions.
How can I select the layoutfile early in the application depending of a value in the request (parsed by urlManager)?