Reputation: 1063
As far as I noticed seeking across the internet, there's no nice&smooth method for template inheritance in Yii, but I'm wondering if there's a nice method to at least overwrite $content in a template. Basically, I'm trying to avoid something like this:
// Let's say that I have a website with a nice layout and I created a "support" module and in its main theme I want to add a nice heading and some activity status under the $content
// modules/support/templates/main.php
$content = '<div id="someCoolHeader">lorem ipsum</div>'.$content.'<div id="supportAvailability">'.isSuportActive().'</div>';
require_once(CWebApplication::getViewPath().DIRECTORY_SEPARATOR.'main.php');
How should it get done right?
Upvotes: 0
Views: 47