本文整理汇总了PHP中Templates::display方法的典型用法代码示例。如果您正苦于以下问题:PHP Templates::display方法的具体用法?PHP Templates::display怎么用?PHP Templates::display使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Templates
的用法示例。
在下文中一共展示了Templates::display方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Output
public static function Output(Templates $skin)
{
$format = Util::getvalue('format');
switch ($format) {
case "xml":
$output = Skin::Load('output-xml.xsl');
$output->setcontent($skin->returnXML(), '/xml/*', null);
header("Content-Type: text/xml; charset=UTF-8");
$output->display();
break;
case "json":
$response = Skin::Load('output-xml.xsl');
$response->setcontent($skin->returnXML(), '/xml/*', null);
$output = Skin::Load('output-json.xsl');
$output->setcontent($response->returnDisplay(), '/xml/*', null);
header("Content-Type: application/json; charset=UTF-8");
$output->display();
break;
default:
$skin->display();
break;
}
die;
if ($format == 'json') {
} else {
header("Content-Type: text/xml; charset=UTF-8");
$skin->display();
die;
}
}
示例2: __toString
public function __toString()
{
global $user, $db, $config, $phpdate, $page_title_all, $page_title, $token;
if ($this->displayTPL) {
Templates::display('header');
}
$complete = '
<div class="info ' . $this->type . '"' . (!empty($this->customCSS) ? 'style="' . $this->customCSS . '"' : '') . '>
' . $this->message . '
</div>
';
if (count($this->links) > 0) {
$complete .= '
<br />
';
$i = 0;
foreach ($this->links as $title => $link) {
$complete .= '
' . ($i > 0 ? ' ' : '') . '
<a href="' . $link . '"' . ($i == 0 ? ' class="button darkB"' : '') . '">' . $title . '</a>
';
$i++;
}
$complete .= '
<br /><br /><br />
';
}
if (!$this->displayTPL) {
return $complete;
} else {
echo $token->auto_append($complete);
Templates::display('footer');
die;
}
}
示例3: display
public function display($app = null, $view = null)
{
//add by pantingwen@hotmail.com 2014-08-05 begin
//如果没有指定模板的话,可以默认获取
if (empty($app)) {
$app = $_GET['app'];
}
if (empty($view)) {
$view = $_GET['action'];
}
//add by pantingwen@hotmail.com 2014-08-05 end
//判断当前是不是开启了模板模式
if (!defined('TEMPLATE_OPEN') || !TEMPLATE_OPEN) {
$view_file = APP . '/' . $app . '/View/' . $view . '.view.php';
if (defined("LANG_VIEW") && LANG_VIEW == true) {
//如果语言没定义,就使用英文的语言
if (!defined("LANG")) {
$view_file = APP . '/' . $app . '/View/' . $view . '_EN_US.view.php';
} else {
$view_file = APP . '/' . $app . '/View/' . $view . '_' . LANG . '.view.php';
}
}
if (file_exists($view_file)) {
include_once $view_file;
} else {
echo get_langage_message('system.lang.php', 'VIEW_NOT_FOUND', array('VIEW_FILE' => $view_file));
}
} else {
if (!is_file(CONFIG_TEMPLATE)) {
echo get_langage_message('template.lang.php', 'TEMPLATE_NEED_CONFIG_FILE');
} else {
include_once CONFIG_TEMPLATE;
$tpl = new Templates();
$tpl->set_vars($this->view_data);
$tpl->display($app . '/' . $view);
}
}
}
示例4: array
<?php
require 'base.php';
$categories = ForumCategory::getAllCategories();
Templates::assign('categories', $categories);
PluginHelper::delegate('__onPageDisplay', array($page));
Templates::display('forums');
示例5: array
$pageCreators = PluginHelper::delegate('__onCreatePage', array(substr($pageName, 0, strlen($pageName) - 4), $_GET));
if (count($pageCreators) == 1) {
// Get single page creator
foreach ($pageCreators as $p) {
$pageCreator = $p;
}
// Does it implement PageCreator?
if (!$pageCreator instanceof PageCreator) {
Functions::log(Functions::LOG_ERROR, get_class($pageCreator) . ' does not implement interface PageCreator');
} else {
Templates::assign('pageTitle', $pageCreator->getTitle());
Templates::assign('customContent', $pageCreator->getContent());
Templates::display('custom');
}
exit;
} else {
if (count($pageCreators) > 1) {
// CLASH OF PLUGINS!!
$errorMessage = 'Page Creator conflict for page ' . $pageName . ':<br /><br /><ul>';
foreach ($pageCreators as $package => $pageCreator) {
$errorMessage .= '<b>' . $package . '</b>: ' . get_class($pageCreator);
}
$errorMessage .= '</ul>';
Functions::log(Functions::LOG_ERROR, $errorMessage);
exit;
}
}
}
// Else, show 404 page
Templates::display('404');
示例6: array
<?php
require 'base.php';
PluginHelper::delegate('__onPageDisplay', array($page));
Templates::display('index');
示例7:
<?php
Templates::display('header');
?>
<h1>Welcome.</h1>
<br />
<a href="#" class="button">Button Standard</a>
<a href="#" class="button darkB">Button Dark</a>
<a href="#" class="button greyB">Button Grey</a>
<?php
Templates::display('footer');
示例8: header
<?php
require 'base.php';
if ($userManager->loggedIn()) {
if ($_GET['logout'] == 1) {
$userManager->logout();
header("Location: ./login.php");
exit;
} else {
header("Location: ./");
exit;
}
}
$errorMessage = false;
if (isset($_POST['submit'])) {
$username = $_POST['username'];
$password = $_POST['password'];
if ($userManager->login($username, $password, false, '/')) {
header("Location: ./");
exit;
} else {
$errorMessage = 'Wrong username or password.';
}
}
PluginHelper::delegate('__onPageDisplay', array($page));
Templates::display('login');
示例9: max
<?php
require 'base.php';
require LANGS . 'ForumT.php';
ForumT::init();
$topic = ForumTopic::fromID((int) $_GET['id']);
if (!$topic instanceof ForumTopic) {
echo ErrorMessage::setText(ForumT::get('topic_doesnt_exist'), true);
}
$forum = $topic->getForum();
$posts = $topic->getPosts(Config::get('max_posts_perpage'), max((int) $_GET['page'], 1));
Templates::assignVars(array('forum' => $forum, 'topic' => $topic, 'posts' => $posts['posts'], 'pages' => $posts['pages']));
PluginHelper::delegate('__onPageDisplay', array($page));
Templates::display('viewtopic');
示例10: array
<?php
require 'base.php';
require LANGS . 'ForumT.php';
ForumT::init();
$forum = Forum::fromID((int) $_GET['id']);
if (!$forum instanceof Forum) {
echo ErrorMessage::setText(ForumT::get('forum_doesnt_exist'), true);
}
$topics = $forum->getTopics();
Templates::assignVars(array('forum' => $forum, 'topics' => $topics['topics'], 'topics_pages' => $topics['pages']));
PluginHelper::delegate('__onPageDisplay', array($page));
Templates::display('viewforum');
示例11:
<?php
include 'base.php';
$profileUser = UserReadOnly::fromID((int) $_GET['id']);
if (!$profileUser instanceof UserReadOnly) {
$errorMessage = 'User does not exist.';
echo ErrorMessage::setText($errorMessage, true);
} else {
Templates::assign('profileUser', $profileUser);
}
Templates::display('user');