Yii, CRUD, CListView and Smarty

Hi all,

First of all, I’m new to both Yii and Smarty.

I’m having a problem with converting the CRUD generated view (_view.php) to a Smarty template (_view.tpl). Basically, I want to remove all PHP codes from the php file (e.g <?php echo CHtml::encode($data->getAttributeLabel(‘name’)); ?>).

I can’t get the $data variable and associated values. I’ve tried setting some Smarty variable in _view.tpl with the PHP code above but it’s not evaluated. I’ve seen there’s a {php} tag which I’m not willing to use since it’s deprecated.

Any ideas ?

The solution has been to write a smarty plugin

there already exists a smarty plugin, which i haven’t tested though

did you write a new one?

did you succeed in using smarty alongside with yii without having to sacrifice any functionality?

which smarty version did you use?

i used to enjoy smarty a lot before i started using yii and i still miss it from time to time…