本文整理汇总了PHP中TPL::dirpath方法的典型用法代码示例。如果您正苦于以下问题:PHP TPL::dirpath方法的具体用法?PHP TPL::dirpath怎么用?PHP TPL::dirpath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TPL
的用法示例。
在下文中一共展示了TPL::dirpath方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: header
public static function header($code, $message = '')
{
switch ($code) {
case 400:
header('HTTP/1.1 400 Bad Request');
break;
case 404:
header('HTTP/1.1 404 Not Found');
break;
case 503:
default:
header('HTTP/1.1 503 Service Unavailable');
break;
}
try {
TPL::trash();
TPL::$dirpath = ESCMS_PATH_TPL . '.debug/';
TPL::add(array('EXCEPTION_MESSAGE' => $message));
if (!TPL::addTpl('header' . $code)) {
switch ($code) {
case 400:
die('<h1>HTTP/1.1 400 Bad Request</h1><p>' . $message . '</p>');
break;
case 404:
die('<h1>HTTP/1.1 404 Not Found</h1>');
break;
case 503:
default:
throw new Exception($message);
}
} else {
TPL::pack();
die;
}
} catch (Exception $exc) {
die('<h1>503 Service Unavailable</h1><p>' . $exc->getMessage() . '</p>');
}
}
示例2: strtotime
case 'timestamp':
$cfg['etc'][$item->module][$item->name] = strtotime($item->value);
if ((int) $item->assign) {
TPL::add(strtoupper($item->name), formatDateTime($cfg['etc'][$item->module][$item->name]));
}
break;
default:
$cfg['etc'][$item->module][$item->name] = $item->value;
if ((int) $item->assign) {
TPL::add(strtoupper($item->name), $cfg['etc'][$item->module][$item->name]);
}
break;
}
}
}
// Configure the template system
if (defined('TEMPLATE_DIRPATH')) {
TPL::$dirpath = TEMPLATE_DIRPATH;
} else {
TPL::$dirpath = './styles/' . $cfg['etc']['core']['site_style'] . '/';
}
// Init the language system
if (defined('IN_SYS') && IN_SYS) {
Langs::$dirpath = './langs/' . $cfg['etc']['core']['site_lang'] . '/';
} else {
Langs::$dirpath = './langs/' . $cfg['etc']['core']['acp_lang'] . '/';
}
define('SITE_ROOT_PATH', $cfg['etc']['core']['SITE_ROOT_PATH']);
TPL::add('HTTP_REFERER', $_SERVER['HTTP_REFERER']);
// Init the modules
Modules::load();
示例3: array
<?php
require_once './app/config.php';
header('Content-Type: text/html; charset=' . ESCMS_OUTPUT_ENCODING);
require_once './app/layers/debug.layer.php';
set_exception_handler(array('Debug', 'catchException'));
set_error_handler(array('Debug', 'catchError'));
date_default_timezone_set(ESCMS_TIMEZONE);
Debug::$enabled = ESCMS_DEBUG_ENABLE;
require_once './app/layers/lib.layer.php';
require_once './app/layers/dal.layer.php';
require_once './app/layers/tpl.layer.php';
require_once './app/layers/core.layer.php';
Lib::$dirpath = ESCMS_PATH_LIB;
SQL::$dirpath = ESCMS_PATH_DAL_DRIVERS;
TPL::$dirpath = ESCMS_PATH_TPL . 'looksmog/';
# replace! -> db
TPL::add('SITE_ROOT_PATH', SITE_ROOT_PATH);
switch (ESCMS_DB_TYPE) {
case 'sqlite2':
$params = array('file' => ESCMS_DB_FILE);
break;
}
SQL::openConnection(array('type' => ESCMS_DB_TYPE, 'prefix' => ESCMS_DB_PREFIX, 'params' => $params));
if (defined('REQUEST_RAW') && !defined('REDIRECTED')) {
$e = explode(SITE_ROOT_PATH, 'http://' . $_SERVER['HTTP_HOST'] . REQUEST_RAW, 2);
TPL::add('PAGE_URI', SITE_ROOT_PATH . $e[1]);
define('REQUEST', '/' . end($e));
require_once './app/resolve.php';
die;
} else {