本文整理汇总了PHP中TemplateEngine::init方法的典型用法代码示例。如果您正苦于以下问题:PHP TemplateEngine::init方法的具体用法?PHP TemplateEngine::init怎么用?PHP TemplateEngine::init使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TemplateEngine
的用法示例。
在下文中一共展示了TemplateEngine::init方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
/**
* @see wcf\system\template\TemplateEngine::__construct()
*/
protected function init()
{
parent::init();
$this->templatePaths = array(1 => WCF_DIR . 'acp/templates/');
$this->compileDir = WCF_DIR . 'acp/templates/compiled/';
if (!defined('NO_IMPORTS')) {
$this->loadTemplateListeners();
}
}
示例2: unset
/*| database |~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|*/
try {
DB::construct($cfg['db']['engine']);
DB::connect($cfg['db']['host'], $cfg['db']['username'], $cfg['db']['password'], $cfg['db']['port']);
DB::selectDB($cfg['db']['database']);
DB::setPrefix($cfg['db']['table_prefix']);
// i always unset the db password once it is not needed
unset($cfg['db']['password']);
} catch (DBError $e) {
trigger_error("Database Connection Error: " . $e->getMessage());
echo "Database Connection Error. Reload the page to try again.";
exit;
}
/*| template engine |~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|*/
Session::init($cfg['guid']);
TemplateEngine::init($cfg['dwoo_template_directory'], $cfg['dwoo_compiled_directory'], $cfg['dwoo_cache_directory']);
/*| magic quotes |~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|*/
if (get_magic_quotes_gpc()) {
function stripslashes_recurse($value)
{
$value = is_array($value) ? array_map('stripslashes_recurse', $value) : stripslashes($value);
return $value;
}
$_GET = array_map('stripslashes_recurse', $_GET);
$_POST = array_map('stripslashes_recurse', $_POST);
$_COOKIE = array_map('stripslashes_recurse', $_COOKIE);
}
/*| debug |~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|*/
if ($cfg['debug']) {
if (trim($cfg['firephp_path']) != '') {
require_once $cfg['firephp_path'];