本文整理汇总了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");
示例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;
}
示例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);
示例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]));
}
}
示例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');
示例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');
*/
示例7: template
<?php
global $template;
$template = new template();
$template->load_file("404");
?>
Sorry, this page has been removed.
示例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'));