本文整理匯總了PHP中smarty::__construct方法的典型用法代碼示例。如果您正苦於以下問題:PHP smarty::__construct方法的具體用法?PHP smarty::__construct怎麽用?PHP smarty::__construct使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類smarty
的用法示例。
在下文中一共展示了smarty::__construct方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: __construct
public function __construct()
{
global $config;
parent::__construct();
// Look for smarty directories, since they are defined relative to jetbird root
$this->template_dir = find($config['smarty']['template_dir']);
$this->common_dir = find("template/common");
$this->compile_dir = find($config['smarty']['compile_dir']);
$this->cache_dir = find($config['smarty']['cache_dir']);
$this->config_dir = find($config['smarty']['config_dir']);
if (!empty($_SESSION['template'])) {
$config['smarty']['template'] = $_SESSION['template'];
}
if (!is_readable($this->template_dir . $config['smarty']['template'] . '/') || $config['smarty']['template'] == "rss") {
$this->template = "default";
} else {
$this->template = $config['smarty']['template'];
}
$this->template_dir .= $this->template;
$this->compile_id = $this->template;
// Assign some vars
$this->assign("template_dir", $this->template_dir);
$this->assign("common_dir", $this->common_dir);
$this->assign("jquery", $this->common_dir . "/js/jquery-1.3.2.min.js");
$this->register_modifier('truncate', 'truncate');
$this->register_modifier('bbcode', 'BBCode');
$this->register_modifier('strip_bbcode', "strip_bbcode");
}