本文整理汇总了PHP中TPL::addTpl方法的典型用法代码示例。如果您正苦于以下问题:PHP TPL::addTpl方法的具体用法?PHP TPL::addTpl怎么用?PHP TPL::addTpl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TPL
的用法示例。
在下文中一共展示了TPL::addTpl方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ESCMSModule_Sys_blog
{
}
$blog = new ESCMSModule_Sys_blog();
$blog->getCategories();
if (!isset($_GET['c']) || $_GET['c'] == 'blog' && !isset($_GET['slug'], $_GET['section']) && isset($_GET['archive'])) {
if (!isset($_GET['archive']) || !isset($_GET['selectmode'])) {
TPL::addTpl('index');
} else {
TPL::addTpl('archive');
}
$blog->getLatestPosts();
}
if (isset($_GET['c']) && $_GET['c'] == 'blog') {
if (isset($_GET['section'])) {
switch ($_GET['section']) {
case 'category':
if (isset($_GET['slug'])) {
TPL::add('BLOG_CATEGORY_HEADER', $blog->getCategoryInfo($_GET['slug'])->category_header);
TPL::addTpl('blog_category');
$blog->getCategoryPosts($_GET['slug']);
}
break;
case 'post':
if (isset($_GET['slug'])) {
TPL::addTpl('blog_post');
$blog->getPost($_GET['slug']);
}
break;
}
}
}
示例2: 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>');
}
}
示例3: array
if (permission('core', 'modules', 'show')) {
Modules::$modules->menu->menu->acp->main->addItem('./acp.php?c=modules', '{L_MODULES}', array('ACTIVE' => isset($_GET['c']) && $_GET['c'] == 'modules'));
}
if (permission('core', 'config', 'edit')) {
Modules::$modules->menu->menu->acp->main->addItem('./acp.php?c=config&module=core', '{L_SITE_CONFIG}', array('ACTIVE' => isset($_GET['c'], $_GET['module']) && $_GET['c'] == 'config' && $_GET['module'] == 'core'));
}
if (!isset($_GET['c'])) {
TPL::add('SITE_TITLE', '{SITE_HEADER} / {L_ACP}');
} else {
switch ($_GET['c']) {
/* case('config'):
if(isset($_GET['module']) && $_GET['module'] == $MODULE_NAME)
$this->modules[$MODULE_NAME]->_module_config_load();
break;*/
case 'modules':
TPL::addTpl('modules');
TPL::add('SITE_TITLE', '{L_MODULES} — {SITE_HEADER} / {L_ACP}');
$codenames = array();
$f_modules_core = array();
$f_modules_additional = array();
$sql = new SQLObject();
if ($sql->query("\r\nSELECT filename,seq,core,name,description,version,active FROM " . $sql->table('modules') . " WHERE (core = 1)\r\nUNION\r\nSELECT filename,seq,core,name,description,version,active FROM " . $sql->table('modules') . " WHERE (core = 0)\r\nORDER BY seq ASC")) {
foreach ($sql->fetch() as $module) {
if ((int) $module->core == 1) {
$f_modules_core[] = array('MODULE_CODENAME' => str_replace('.mod.php', '', $module->filename), 'MODULE_NAME' => $module->name, 'MODULE_DESCRIPTION' => $module->description, 'MODULE_PATH' => './app/modules/' . $module->filename, 'MODULE_ICON' => './app/modules/' . str_replace('.mod.php', '.icon.png', $module->filename), 'conds' => array('ACTIVE' => (bool) (int) $module->active));
} else {
$f_modules_additional[] = array('MODULE_CODENAME' => str_replace('.mod.php', '', $module->filename), 'MODULE_NAME' => $module->name, 'MODULE_DESCRIPTION' => $module->description, 'MODULE_PATH' => './modules/' . $module->filename, 'MODULE_ICON' => './modules/' . str_replace('.mod.php', '.icon.png', $module->filename), 'conds' => array('ACTIVE' => (bool) (int) $module->active));
}
$codenames[(int) $module->core][] = $module->filename;
}
}
示例4: array
<?php
TPL::addTpl('header');
TPL::modify('TPL::addTpl(\'side\');');
TPL::modify('TPL::addTpl(\'footer\');');
/*
// create a new cURL resource
$ch = curl_init();
// set URL and other appropriate options
curl_setopt($ch, CURLOPT_URL, 'https://www.google.com/accounts/o8/id');
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Accept: application/xrds+xml'));
#curl_setopt($ch, CURLOPT_HEADER, 0);
// grab URL and pass it to the browser
echo(curl_exec($ch));
// close cURL resource, and free up system resources
curl_close($ch);
*/
示例5: SQLObject
$sql = new SQLObject();
if ($sql->exec("DELETE FROM " . $sql->table('auth_permissions') . " WHERE (group_id = " . intval($_GET['group_id']) . ")")) {
if ($sql->exec("DELETE FROM " . $sql->table('auth_groups') . " WHERE (group_id = " . intval($_GET['group_id']) . ")")) {
TPL::addTpl('alert_success');
TPL::add('ALERT_MESSAGE', '{L_AUTH_ALERT_GROUP_DELETED}');
TPL::cond('BACKLINK', true);
TPL::add('BACKLINK', './acp.php?c=users&section=groups');
TPL::add('BACKLINK_TEXT', '{L_BACKLINK}');
} else {
TPL::addTpl('alert_error');
TPL::add('ALERT_MESSAGE', '{L_AUTH_ALERT_GROUP_ONLY_PERMISSIONS_DELETED}');
}
} else {
TPL::addTpl('alert_error');
TPL::add('ALERT_MESSAGE', '{L_AUTH_ALERT_DELETE_GROUP_ERROR}');
}
TPL::pack();
}
} else {
TPL::addTpl('alert_error');
TPL::add('ALERT_MESSAGE', '{L_PERMISSION_AUTH_DELETE_GROUP}');
TPL::pack();
}
break;
}
}
break;
}
}
}
}