当前位置: 首页>>代码示例>>PHP>>正文


PHP TemplateEngine::init方法代码示例

本文整理汇总了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();
     }
 }
开发者ID:ZerGabriel,项目名称:WCF,代码行数:12,代码来源:ACPTemplateEngine.class.php

示例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'];
开发者ID:c13arm,项目名称:MUN-School-Work,代码行数:31,代码来源:init.php


注:本文中的TemplateEngine::init方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。