据我发现在互联网上搜索,在Yii中没有很好的模板继承方法,但是我想知道是否有一个很好的方法来至少覆盖模板中的$ content。基本上,我试图避免这样的事情:
// 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');
如何正确完成?