diff --git a/framework/renderers/TwigViewRenderer.php b/framework/renderers/TwigViewRenderer.php index def90b4..e719ef1 100644 --- a/framework/renderers/TwigViewRenderer.php +++ b/framework/renderers/TwigViewRenderer.php @@ -25,6 +25,12 @@ class TwigViewRenderer extends ViewRenderer public $fileExtension = 'twig'; /** + * @var array options + * @see http://twig.sensiolabs.org/doc/api.html#environment-options + */ + public $options = array(); + + /** * @var \Twig_Environment */ protected $_twig; @@ -34,9 +40,10 @@ class TwigViewRenderer extends ViewRenderer \Yii::setAlias('@Twig', $this->twigDir); $loader = new \Twig_Loader_String(); - $this->_twig = new \Twig_Environment($loader, array( + + $this->_twig = new \Twig_Environment($loader, array_merge(array( 'cache' => \Yii::getAlias($this->cacheDir), - )); + ), $this->options)); } /**