/**
  * @desc Builds a FileTemplate object
  * @param string $file_identifier The identifier of the file you want to load (see this class' description)
  * to know how to compose a indentifier.
  */
 public function __construct($file_identifier)
 {
     $this->file_identifier = $file_identifier;
     $data = new DefaultTemplateData();
     $data->auto_load_frequent_vars();
     $loader = new FileTemplateLoader($this->file_identifier, $data);
     $renderer = new DefaultTemplateRenderer();
     parent::__construct($loader, $renderer, $data);
 }
 /**
  * @desc Constructs a StringTemplate
  * @param string $content The content of the template (a string containing PHPBoost's template engine syntax).
  * @param bool $use_cache Controls if it has or not to use cache
  * @param bool $auto_load_vars Tells whether it has to load or not the most common variables.
  */
 public function __construct($content, $use_cache = self::USE_CACHE_IF_FASTER)
 {
     $data = new DefaultTemplateData();
     $data->auto_load_frequent_vars();
     $renderer = new DefaultTemplateRenderer();
     if ($this->has_to_cache($content, $use_cache)) {
         $loader = new CachedStringTemplateLoader($content);
     } else {
         $loader = new StringTemplateLoader($content);
     }
     parent::__construct($loader, $renderer, $data);
 }
Example #3
0
 public function __construct($config, $auth)
 {
     parent::__construct($config, $auth);
     $this->smarty = new Smarty();
     $this->smarty->template_dir = dirname(__FILE__) . "/smarty/templates/";
     $this->smarty->compile_dir = dirname(__FILE__) . "/smarty/templates_c/";
     $this->smarty->register_modifier("encodeMessageID", array($config, "encodeMessageID"));
     $this->smarty->register_modifier("calculateFileSize", array($this, "calculateFileSize"));
     $this->smarty->assign("ROOTBOARD", $this->parseBoard($config->getBoard()));
     $this->smarty->assign("VERSION", $config->getVersion());
     $this->smarty->assign("ISANONYMOUS", $this->getAuth()->isAnonymous());
     $this->smarty->assign("ADDRESS", $this->getAuth()->getAddress());
 }
Example #4
0
 /**
  * Passes the template name with appropriate prefix up to the template
  * constructor.
  *
  * @param  string  $t  The template to use.
  */
 public function __construct($t)
 {
     parent::__construct('content/' . $t);
 }
 public function __construct($f3, $view)
 {
     parent::__construct($f3, $view);
 }