rsol / fenom
Yii Fenom view renderer
1.0.1
2013-07-21 20:01 UTC
Requires
- php: >=5.3.0
- fenom/fenom: 1.*
This package is not auto-updated.
Last update: 2025-01-14 23:05:57 UTC
README
Install
- Use composer package "rsol/fenom": "dev-default"
- Set alias "vendor"
Yii::setPathOfAlias('vendor','path_to_composer_vendor_folder');
- In "main.php" config file in section "components" add
... 'viewRenderer' => array( 'class' => 'vendor.rsol.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 ), ...
In your action use:
$this->render('//fenom/test', array(
// 'citys'=>array()
'citys'=>Yii::app()->db->createCommand()
->select('id, name')
->from('city')
->limit(10)
->queryAll(),
));
Template
<h1>Fenom</h1>
<ul>
{foreach $citys as $city}
<li><a href="#{$city.id}">{$city.name}</li>
{foreachelse}
<li>Empty</li>
{/foreach}
</ul>