Have a look at this extension for Smarty template engine: smarty-view-renderer
Basically, you write a Component for Yii that implements IViewRenderer
. Then override init()
and implement renderFile()
, and then in your main.php
config file, you set viewRenderer
to your Component class. Something like this:
'components' => array(
...
'viewRenderer'=>array(
'class'=>'application.extensions.path.to.your.class',
'fileExtension' => '.ext', // file extension to be handled by PHPTAL
//other configurations for your component
),
and it will work like a charm.
But if you don't insist on PHPTAL, Smarty is there ready for you.