Hi there, I’m new to Yii and this is my first post so be kind please!
Couldn’t find a better and more clear topic title but the question is quite simple, is it possible to pass variables from a controller to a view if layouts are involved in the render?
When calling render() in the controller you pass all variables as an array in the second argument. They will be available in the view as variables with names matching keys from that array.
Now in the layout view file the contents of rendered view is available in the $contents variable.
I read the manual about passing variables to the view. The fact is that it doesn’t work for me. I can access controller’s properties with $this in the view though.