/** * Constructor * @param string $template [optional] : name of the template to load (without the .tpl) * @param array $info [optional default Array()] : array containing page's meta informations, title, cache, cache_version, etc... * cach_lifetime : false or 0 to disactivate caching, null for default, or int to set cache lifetime * Set cache_version if you want to separate cache into versions */ public function __construct($template = false, $info = array()) { BF::register_error_output_callback(array($this, "show_error")); // > Define runtime variables parent::__construct(); $this->compile_check = BF::gc('template_compile_check'); $this->debugging = BF::gc('template_smarty_debug'); $this->template_dir = BF::gf('tpl')->path(); $this->compile_dir = BF::gf('compiled')->path(); $this->cache_dir = BF::gf('cached')->path(); $this->addPluginsDir(BF::gf('tags')->path()); $this->content_type = BF::gc('template_default_content_type'); $this->error_reporting = BF::gc('error_reporting'); // > Caching // block for non-cachable content $this->cache_lifetime = BF::gc('template_cache_lifetime'); $this->caching = BF::gc('template_cache') ? 1 : 0; //$this->cache_version = null; // > Register template infos $this->data = array(); $this->assignByRef("_data", $this->data); // > Register common template functions and blocks. Others will be found in the tags dir $this->loadFilter('pre', 'translate'); // trim top and bottom $this->registerFilter("output", create_function('$x', 'return trim($x);')); if ($template !== false) { $this->load($template, $info); } }
function __construct() { BF::register_error_output_callback(array($this, "show_error")); }