Skip to content

jazahn/smarty-renderer

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Smarty view renderer

This extension allows you to use Smarty version 3 templates in Yii.

###Resources

###Requirements

  • Yii 1.0 or above
  • Smarty 3.0.6 or above

###Installation

  • Extract the release file under protected/extensions.
  • Download and extract libs folder contents of Smarty package under protected/vendors/Smarty.
  • Add the following to your config file 'components' section:
<?php
// ...
'viewRenderer'=>array(
  'class'=>'application.extensions.yiiext.renderers.smarty.ESmartyViewRenderer',
    'fileExtension' => '.tpl',
    //'pluginsDir' => 'application.smartyPlugins',
    //'configDir' => 'application.smartyConfig',
    //'prefilters' => array(array('MyClass','filterMethod')),
    //'postfilters' => array(),
    //'config'=>array(
    //    'force_compile' => YII_DEBUG,
    //   ... any Smarty object parameter
    //)
),

There are some more options on configuring Smarty properties now. Will add documentation soon.

###Usage

  • Smarty documentation.
  • Current controller properties are accessible via {$this->pageTitle}.
  • Yii properties are available as follows: {Yii::app()->theme->baseUrl}.
  • Used memory is stored in {$MEMORY}, used time is in {$TIME}.

About

This extension allows you to use Smarty 3 templates in Yii.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%