1

I'm wondering that how to integrate PHPTAL into yii framework? I'm using PHPTAL for a long time and it's nice template engine. Although Yii allows integrate another template engine into framework but it still does not support PHPTAL.

Thanks for your help.

sonnb
  • 418
  • 2
  • 7

1 Answers1

0

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.

Community
  • 1
  • 1
Abbas Mashayekh
  • 301
  • 3
  • 12