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


PHP XTemplate::assign_file方法代码示例

本文整理汇总了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");
    //*** Парсинг элемента меню - Закупки ***
开发者ID:bdf2ch,项目名称:auto,代码行数:31,代码来源:index.php

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

示例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');
开发者ID:D3Cnet,项目名称:cuisine,代码行数:25,代码来源:ex7.php

示例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");
}
开发者ID:bdf2ch,项目名称:auto,代码行数:31,代码来源:globalFunctions.php

示例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();
 }
开发者ID:romlg,项目名称:blank-xpage,代码行数:18,代码来源:xpage_public.php


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