本文整理汇总了PHP中PHPTAL::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPTAL::__construct方法的具体用法?PHP PHPTAL::__construct怎么用?PHP PHPTAL::__construct使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PHPTAL
的用法示例。
在下文中一共展示了PHPTAL::__construct方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct($template = false)
{
$this->setTemplateRepository(self::$_template_dirs);
if (DEBUG) {
$this->setForceReparse(true);
}
parent::__construct($template);
}
示例2: __construct
/**
* 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:
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: __construct
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: __construct
/**
* 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:
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);
}