Установка:
- Скопировать файлы в "protected/extentions/fenom"
- В "main.php" в секции "components" добавить
Код: Выделить всё
... 'viewRenderer' => array( 'class' => 'ext.fenom.RFenomViewRender', // 'templatesDir' => null, //Base dir for templates // 'compiledDir' => null, //Dir for store complited templates // 'options' => null, //Fenom settings // 'fileExtension' => '.tpl', //Fenom template files extension ), ...
Код: Выделить всё
$this->render('//fenom/test', array(
// 'citys'=>array()
'citys'=>Yii::app()->db->createCommand()
->select('id, name')
->from('city')
->limit(10)
->queryAll(),
));
Код: Выделить всё
<h1>Fenom</h1>
<ul>
{foreach $citys as $city}
<li><a href="#{$city.id}">{$city.name}</li>
{foreachelse}
<li>Empty</li>
{/foreach}
</ul>