Creating Views with Different Styles in Body Tag

I’m trying to include iframe in a view file. In the layout main.php I have the header, menu and footer. In my different html inner pages I have different script tags between the head tags and different style inside the body tag.


You may use different layouts, using renderPatial() to include shared view parts.

Other way is to pass differences via controller property (e.g. declare property $bodyStyle = ‘’; in Controller, fill it when you need and call it inside your layout as $this->bodyStyle).

I think the first approach suits better your situation.

I recommend widgets. Create one and call him at your view file.

Happy coding.