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


PHP Templates::display方法代码示例

本文整理汇总了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;
     }
 }
开发者ID:floatla,项目名称:ModLayer-Docs,代码行数:30,代码来源:frontend.php

示例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 ? '&nbsp; &nbsp;' : '') . '
						<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;
        }
    }
开发者ID:GIDIX,项目名称:quicktalk,代码行数:35,代码来源:InfoMessage.php

示例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);
         }
     }
 }
开发者ID:pantingwen,项目名称:sanwenphp,代码行数:38,代码来源:Action.class.php

示例4: array

<?php

require 'base.php';
$categories = ForumCategory::getAllCategories();
Templates::assign('categories', $categories);
PluginHelper::delegate('__onPageDisplay', array($page));
Templates::display('forums');
开发者ID:GIDIX,项目名称:quicktalk,代码行数:7,代码来源:forums.php

示例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');
开发者ID:GIDIX,项目名称:quicktalk,代码行数:30,代码来源:handler.php

示例6: array

<?php

require 'base.php';
PluginHelper::delegate('__onPageDisplay', array($page));
Templates::display('index');
开发者ID:GIDIX,项目名称:quicktalk,代码行数:5,代码来源:index.php

示例7:

<?php

Templates::display('header');
?>

	<h1>Welcome.</h1>

	<br />

	<a href="#" class="button">Button Standard</a> &nbsp;
	<a href="#" class="button darkB">Button Dark</a> &nbsp;
	<a href="#" class="button greyB">Button Grey</a>

<?php 
Templates::display('footer');
开发者ID:GIDIX,项目名称:quicktalk,代码行数:15,代码来源:index.php

示例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');
开发者ID:GIDIX,项目名称:quicktalk,代码行数:26,代码来源:login.php

示例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');
开发者ID:GIDIX,项目名称:quicktalk,代码行数:14,代码来源:viewtopic.php

示例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');
开发者ID:GIDIX,项目名称:quicktalk,代码行数:13,代码来源:viewforum.php

示例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');
开发者ID:GIDIX,项目名称:quicktalk,代码行数:11,代码来源:user.php


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