本文整理汇总了PHP中XTemplate::assign_file方法的典型用法代码示例。如果您正苦于以下问题:PHP XTemplate::assign_file方法的具体用法?PHP XTemplate::assign_file怎么用?PHP XTemplate::assign_file使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XTemplate
的用法示例。
在下文中一共展示了XTemplate::assign_file方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: gmdate
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-cache, must-revalidate");
header("Cache-Control: post-check=0,pre-check=0", false);
header("Cache-Control: max-age=0", false);
header("Pragma: no-cache");
/***** Подключение необходимых библиотек *****/
include 'php/xtemplate.class.php';
include 'php/user.class.php';
include 'php/globalFunctions.php';
/***** Инициализация глобальных переменных и объектов *****/
session_start();
$template = new XTemplate("index.html");
$client = new user();
/***** Сборка основного шаблона *****/
$template->assign_file("MAIN_HEADER", "templates/mainHeader.html");
if ($client->isRegistered()) {
//$template -> assign_file("USER_MENU", "../templates/userMenu.html");
/***** Получение наименования области видимости *****/
$template->assign("USER_VISIBILITY_AREA", $client->getVisibilityAreaTilte());
/***** Получение фио пользователя *****/
$template->assign("USER_FIO", $client->getFio());
/***** Парсинг элемента меню - ДИТ *****/
if ($client->getOblVidId() != 4) {
$template->parse("main.menu.dit");
}
/***** Парсинг элемента меню - Автотранспорт *****/
//if ($client -> isAutoVisible())
$template->parse("main.menu.auto");
$template->parse("main.menu.newHelp");
//*** Парсинг элемента меню - Закупки ***
示例2: assign_file
/**
* Override of parent assign_file method
*
* @access public
* @param string $name Variable to assign $val to
* @param string / array $val Values to assign to $name
*/
public function assign_file($name, $val = '')
{
if (!$this->_template_is_cached) {
parent::assign_file($name, $val);
}
}
示例3: XTemplate
<?php
/**
* example 7
* demonstrates file includes
*
* @package XTemplate_Examples
* @author Barnabas Debreceni [cranx@users.sourceforge.net]
* @copyright Barnabas Debreceni 2000-2001
* @author Jeremy Coates [cocomp@users.sourceforge.net]
* @copyright Jeremy Coates 2002-2007
* @see license.txt LGPL / BSD license
* @link $HeadURL: https://xtpl.svn.sourceforge.net/svnroot/xtpl/trunk/ex7.php $
* @version $Id: ex7.php 16 2007-01-11 03:02:49Z cocomp $
*/
include_once './xtemplate.class.php';
$xtpl = new XTemplate('ex7.xtpl');
$xtpl->assign('FILENAME', 'ex7-inc.xtpl');
// Language is set to English
$xtpl->assign_file('LANGUAGE', 'ex7-inc-eng.xtpl');
// Uncomment the line below to set language to German
//$xtpl->assign_file('LANGUAGE', 'ex7-inc-de.xtpl');
$xtpl->rparse('main.inc');
$xtpl->parse('main');
$xtpl->out('main');
示例4: panorama
function panorama()
{
global $template;
global $client;
$template = new XTemplate("../templates/index.html");
$template->assign_file("MAIN_HEADER", "../templates/mainHeader.html");
if ($client->isRegistered()) {
//$template -> assign_file("USER_MENU", "../templates/userMenu.html");
/***** Получение наименования области видимости *****/
$template->assign("USER_VISIBILITY_AREA", $client->getVisibilityAreaTilte());
/***** Получение фио пользователя *****/
$template->assign("USER_FIO", $client->getFio());
/***** Парсинг элемента меню - ДИТ *****/
$template->parse("main.menu.dit");
/***** Парсинг элемента меню - Автотранспорт *****/
//if ($client -> isAutoVisible())
$template->parse("main.menu.auto");
//*** Парсинг элемента меню - Закупки ***
//if ($client -> isZakupkiVisible()) $template -> parse("main.menu.zakupki");
//*** Парсинг элемента меню - Админка *****/
//if ($client -> isAdministrator()) $template -> parse("main.menu.admin");
}
if ($client->isRegistered()) {
$template->assign_file("USER_MENU", "templates/userMenu.html");
//$template -> assign_file("CONTENT", "../templates/login.html");
} else {
$template->assign_file("USER_MENU", "templates/userMenu_unregistered.html");
}
$template->assign_file("CONTENT", "../templates/auto/panorama.html");
$template->assign("BODY_ID", "at");
}
示例5: Render
function Render()
{
$this->RunController();
$tpl = new XTemplate($this->mainTemplate);
$tpl->assign_file("HEADER_TEMPLATE", $this->headerTemplate);
$tpl->assign_file("FOOTER_TEMPLATE", $this->footerTemplate);
$tpl->assign_array("MAIN.HEADER", $this->HeaderCode());
$tpl->assign_array("MAIN.FOOTER", $this->FooterCode());
if (count($this->data) > 0) {
$tpl->assign_array("MAIN", $this->data);
} else {
$tpl->assign("MAIN_HEADER", $this->pageHeader);
$tpl->parse("MAIN");
}
header("Content-Type: text/html; charset=utf-8");
$tpl->out("MAIN");
$this->Close();
}