示例#1
0
 public function __construct($template = false)
 {
     $this->setTemplateRepository(self::$_template_dirs);
     if (DEBUG) {
         $this->setForceReparse(true);
     }
     parent::__construct($template);
 }
示例#2
0
 /**
  * DECTAL Constructor to set up template and inner template repos
  *
  * @param string|NULL If not NULL, this sets the inner template file
  *    to the given filename.  The template repo is set to the  base template repo
  */
 public function __construct($template = NULL)
 {
     parent::__construct();
     $this->setTemplateRepository('templates/');
     if ($template != NULL) {
         $this->_sub_template = new PHPTAL($template);
     }
 }
示例#3
0
文件: View.php 项目: jeko/pksworld
 function __construct()
 {
     // Default-Werte setzen
     $this->setPageTitle(self::DEFAULT_PAGE_TITLE);
     $this->setTemplateFile(self::DEFAULT_TEMPLATE_FILE);
     $this->setTemplateMacro(self::DEFAULT_TEMPLATE_MACRO);
     // Template-Konstruktor aufrufen
     parent::__construct();
 }
示例#4
0
 public function __construct($template = false)
 {
     parent::__construct($template);
     $this->setTemplateRepository(self::$_template_dirs);
     if (DEBUG) {
         $this->setForceReparse(true);
     }
     $this->static = new Template_StaticContext();
     $this->global = new Template_GlobalContext();
 }
示例#5
0
 /**
  * Constructor
  * @param string $tplName The name of the Template file (without .xml)
  * @throws \Exception
  */
 public function __construct($tplName)
 {
     $this->templateFile = BUZZSEO_DIR . DIRECTORY_SEPARATOR . 'tal' . DIRECTORY_SEPARATOR . $tplName . '.xml';
     if (!is_readable($this->templateFile)) {
         throw new \Exception(sprintf(__('File %s does not exist.', 'buzz-seo'), $this->templateFile), 404);
     }
     // Construct PHPTAL object
     parent::__construct();
     // Add translator
     $this->TalTranslator = new Services\Translation();
     $this->TalTranslator->useDomain('buzz-seo');
     $this->setTranslator($this->TalTranslator);
     // Render as HTML5
     $this->setOutputMode(\PHPTAL::HTML5);
     // Strip comments
     $this->stripComments(true);
     // Set source
     $this->setTemplate($this->templateFile);
 }
示例#6
0
 function __construct()
 {
     //Call PHPTAL constructor (because we can)
     parent::__construct();
     /**
      * Use CI config to set encoding, templates and compiled templates path
      */
     $CI =& get_instance();
     //BUGGGGGG!!!! CI FORUM BUG, REMOVE the ; SYNTAX ERROR!
     /**
      * You can change paths if you need to
      */
     $cache_path = $CI->config->item('cache_path');
     if (empty($cache_path)) {
         $cache_path = APPPATH . 'cache/';
     }
     $this->setEncoding($CI->config->item('charset'));
     $this->setTemplateRepository(APPPATH . 'views/');
     $this->setPhpCodeDestination($cache_path);
 }