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; }
/** * 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); }
/** * 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; }
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); }
/** * 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; }
/** * 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()); }