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


PHP template::load_file方法代码示例

本文整理汇总了PHP中template::load_file方法的典型用法代码示例。如果您正苦于以下问题:PHP template::load_file方法的具体用法?PHP template::load_file怎么用?PHP template::load_file使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在template的用法示例。


在下文中一共展示了template::load_file方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: template

<?php

global $template;
$template = new template();
$template->load_file("head");
$template->load_file("body");
$template->load_file("foot");
开发者ID:hscale,项目名称:BlastPad,代码行数:7,代码来源:main.php

示例2: template

ini_set('include_path', $script_root . 'inc' . PATH_SEPARATOR . $script_root . 'inc/lib' . PATH_SEPARATOR . $script_root . 'languages' . PATH_SEPARATOR);
include 'functions.inc.php';
include 'template.class.inc.php';
include 'log_downloads.class.inc.php';
include 'language.' . $language . '.inc.php';
/*****************************************************
 ** Get server info
 *****************************************************/
if ($debug_mode == 'on') {
    get_phpinfo(array('Script Name' => $script_name, 'Script Version' => $script_version));
}
/*****************************************************
 ** Load template
 *****************************************************/
$tpl = new template();
$tpl->load_file('dlcl', $template_file);
/*****************************************************
 ** Take care for older PHP-Versions
 *****************************************************/
if (isset($HTTP_GET_VARS) and !empty($HTTP_GET_VARS)) {
    $_GET = $HTTP_GET_VARS;
}
if (isset($HTTP_POST_VARS) and !empty($HTTP_POST_VARS)) {
    $_POST = $HTTP_POST_VARS;
}
if (isset($HTTP_SERVER_VARS) and !empty($HTTP_SERVER_VARS)) {
    $_SERVER = $HTTP_SERVER_VARS;
}
if (isset($HTTP_SESSION_VARS) and !empty($HTTP_SESSION_VARS)) {
    $_SESSION = $HTTP_SESSION_VARS;
}
开发者ID:superman1982,项目名称:0019,代码行数:31,代码来源:download_center_lite.inc.php

示例3: template

/*****************************************************
 ** Links always point to the Document URI if exists
 *****************************************************/
if (isset($_SERVER['DOCUMENT_URI']) and !empty($_SERVER['DOCUMENT_URI'])) {
    $document_self = $_SERVER['DOCUMENT_URI'];
} else {
    $document_self = $script_self;
}
/*****************************************************
 ** Initialyze template class
 *****************************************************/
$tpl = new template();
/*****************************************************
 ** Load layout html template
 *****************************************************/
$tpl->load_file($tplt, $path['templates'] . $tmpl['layout']);
/*****************************************************
 ** Register language file and additional text array
 *****************************************************/
if (isset($txt) and is_array($txt)) {
    reset($txt);
    while (list($key, $val) = each($txt)) {
        ${$key} = $val;
        $tpl->register($tplt, $key);
    }
}
if (isset($add_text) and is_array($add_text)) {
    reset($add_text);
    while (list($key, $val) = each($add_text)) {
        ${$key} = $val;
        $tpl->register($tplt, $key);
开发者ID:rhempen,项目名称:cms,代码行数:31,代码来源:core.inc.php

示例4: array

 * OR  IN  CONNECTION WITH THE SOFTWARE OR THE USE OR
 * OTHER DEALINGS IN THE SOFTWARE.
 */
/*****************************************************
 ** List of  some example extenstions
 *****************************************************/
$extension_list = array('bmp', 'dat', 'doc', 'gif', 'html', 'jpg', 'mdb', 'pdf', 'php', 'png', 'ppt', 'rar', 'rtf', 'tar', 'tif', 'txt', 'xls', 'zip', 'tar.gz');
/*****************************************************
 ** Include template class
 *****************************************************/
include './inc/template.class.inc.php';
/*****************************************************
 ** Load template
 *****************************************************/
$tpl = new template();
$tpl->load_file('global', './templates/test.tpl.html');
/*****************************************************
 ** Parse global template (mostly for user debugging)
 *****************************************************/
if (isset($add_text) and is_array($add_text)) {
    reset($add_text);
    foreach ($add_text as $key => $val) {
        ${$key} = $val;
        $tpl->register('global', $key);
    }
}
if (isset($extension_list) and !empty($extension_list) and is_array($extension_list)) {
    for ($i = 0; $i < count($extension_list); $i++) {
        $extensions[] = array('EXT' => strtoupper($extension_list[$i]), 'ext' => strtolower($extension_list[$i]));
    }
}
开发者ID:superman1982,项目名称:0019,代码行数:31,代码来源:test.php

示例5: array

** Filename.....: seperate-script.php
** Author.......: Richard Heyes
** Version......: 1.0
** Notes........: This shows how you can
**                use multiple template files.
** Last changed.: 23/05/00
** Last change..:
***************************************/
include 'class.template.inc';
/***************************************
** Set a couple of example variables.
***************************************/
$test_var = 'Hello world!';
$page_title = 'Template Class';
/***************************************
** Set a couple of example arrays.
***************************************/
$table_rows = array();
$table_rows[] = array('column_1' => 'This is column one on row one!', 'column_2' => 'This is column two on row one!', 'column_3' => 'This is column three on row one!');
$table_rows[] = array('column_1' => 'This is column one on row two!', 'column_2' => 'This is column two on row two!', 'column_3' => 'This is column three on row two!');
/***************************************
** The template goodies.
***************************************/
$tpl = new template();
$tpl->load_file('header', 'header-template.html');
$tpl->load_file('main', 'main-template.html');
$tpl->load_file('footer', 'footer-template.html');
$tpl->register('header', 'test_var, page_title');
$tpl->parse('header, main, footer');
$tpl->parse_loop('main', 'table_rows');
$tpl->print_file('header, main, footer');
开发者ID:innomatic-libs,项目名称:rhtemplatelib,代码行数:31,代码来源:seperate-script.php

示例6: array

$table_rows[] = array('column_1' => 'This is column one on row two!', 'column_2' => 'This is column two on row two!', 'column_3' => 'This is column three on row two!');
/***************************************
** Postgres stuff. This was the code I
** used to test the $obj->parse_pgsql()
** method. Worked too.
***************************************/
/*
        $pg = pg_connect('user=richard dbname=scripts port=5432');

        $sqlquery = 'SELECT col1 AS column_1, col2 AS column_2, col3 AS column_3 FROM test';
        $table_rows = pg_exec($pg, $sqlquery);
*/
/***************************************
** The template goodies, using shortcut
** functions.
***************************************/
$tpl = new template();
$tpl->load_file('complete', 'complete-template.html');
$tpl->parse_loop('complete', 'table_rows');
$tpl->pprint('complete', array('test_var', 'page_title'));
/***************************************
** The template goodies, using the
** longer method.
***************************************/
/*
        $tpl->load_file('complete', 'complete-template.html');
        $tpl->register('complete', 'test_var,page_title');
        $tpl->parse('complete');
        $tpl->parse_loop('complete', 'table_rows');
        $tpl->print_file('complete');
*/
开发者ID:innomatic-libs,项目名称:rhtemplatelib,代码行数:31,代码来源:complete-script.php

示例7: template

<?php

global $template;
$template = new template();
$template->load_file("404");
?>

Sorry, this page has been removed.
开发者ID:hscale,项目名称:BlastPad,代码行数:8,代码来源:404.php

示例8: template

<?php

include 'tplutil.inc';
include 'class.template.inc';
$GLOBALS['TITLE'] = 'My Title';
$GLOBALS['USER'] = get_user();
$GLOBALS['users'] = get_users(true);
$tpl = new template();
$tpl->load_file('main', 'slides/pragmatic/templateclass.tpl');
$tpl->parse_loop('main', 'users');
$tpl->pprint('main', array('USER', 'TITLE'));
开发者ID:SandyS1,项目名称:presentations,代码行数:11,代码来源:templateclass.php


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