예제 #1
0
 public function __construct($file = null, array $data = null)
 {
     $token = Kohana::$profiling ? Profiler::start('renderer', 'new kohana view') : false;
     $this->_config = Kohana::config('render');
     parent::__construct($file, $data);
     $token ? Profiler::stop($token) : null;
 }
예제 #2
0
 /**
  * Sets the initial view filename and local data. Views should almost
  * always only be created using [View::factory].
  *
  *     $view = new View($file);
  *
  * @param   string  view filename
  * @param   array   array of values
  * @return  void
  * @uses    View::set_filename
  */
 public function __construct($file = NULL, array $data = NULL)
 {
     if (self::is_smarty_template($file)) {
         throw new Kohana_Exception('Cannot initialise Smarty template :tpl as new View; use View::factory instead', array(':tpl' => $file));
     }
     return parent::__construct($file, $data);
 }
예제 #3
0
 /**
  * Constructor
  *
  * @param array $data 
  * @author Jonathan Geiger
  */
 public function __construct($file = NULL, $data = NULL, $env = 'default')
 {
     parent::__construct($file, $data);
     // Allow passing a Twig_Environment
     if (is_string($env)) {
         $env = Kohana_Twig_Environment::instance($env);
     }
     $this->_environment = $env;
 }
예제 #4
0
 public function __construct($options = NULL, array $data = NULL)
 {
     Kohana::$profiling === TRUE && ($bm = Profiler::start('View', __FUNCTION__));
     $this->_compile_dir = APPPATH . 'cache/haml/';
     if (!is_dir($this->_compile_dir)) {
         mkdir($this->_compile_dir, 0777, TRUE);
     }
     parent::__construct($options, $data);
     isset($bm) && Profiler::stop($bm);
 }
예제 #5
0
파일: view.php 프로젝트: Zeelot/yuriko_cms
 /**
  * Sets the initial view filename and local data.
  *
  * @param   string  view filename
  * @param   array   array of values
  * @return  void
  */
 public function __construct($file = NULL, array $data = NULL)
 {
     parent::__construct($file, $data);
     //add this view to $loaded (only once)
     self::$loaded[$file] = $file;
 }
예제 #6
0
파일: Twig.php 프로젝트: Burgestrand/kotwig
 /**
  * Loads the View environment
  */
 public function __construct($file = NULL, array $data = NULL)
 {
     parent::__construct($file, $data);
     $this->_twig = new Twig_Environment(new Kotwig_Loader_View(), Kohana::config('twig')->as_array());
 }