Author: Jonathan Geiger
示例#1
0
 /**
  * Constructor
  *
  * @param array $data 
  * @author Jonathan Geiger
  */
 public function __construct($file = NULL, $data = NULL, $env = 'default')
 {
     if ($file !== NULL) {
         $this->set_filename($file);
     }
     // Allow passing the environment if $data is not needed
     if (is_string($data)) {
         $env = $data;
         $data = NULL;
     }
     if ($data !== NULL) {
         // Add the values to the current data
         $this->data = $data + $this->data;
     }
     // Allow passing a Twig_Environment
     if ($env instanceof Twig_Environment == FALSE) {
         // Load the default extension from the config
         $this->extension = Kohana::config('twig.' . $env . '.loader.extension');
         $env = Kohana_Twig::instance($env);
     }
     $this->environment = $env;
 }
示例#2
0
 /**
  * @return string|null
  */
 public static function suffix()
 {
     return Kohana_Twig::config('suffix');
 }