Pass Variable to SiteLayout inside VIEW

Hi there,

in my view there is a certain layout I use:


<?php $this->layout='AdminView'; #here pass variable to layout?>

My VIEW Content



How Can I pass variables to the AdminView inside the view?

Best regards,

peili

Is there a reason you don’t want to make it a property of the controller?

That would enable you to:

$this->layout = ‘AdminView’;

$this->layoutProperty = ‘xyz’;

Then, in your AdminView, pull the property $this->layoutProperty where you want to check it (and you can have a default value for it in the Controller.

Just be sure to add it to your base Controller class so that all Controllers inherit the property.

I think it depends on value you want to pass to layout. Sometimes it’s better to make a widget.