本文整理汇总了PHP中Template::pparse方法的典型用法代码示例。如果您正苦于以下问题:PHP Template::pparse方法的具体用法?PHP Template::pparse怎么用?PHP Template::pparse使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Template
的用法示例。
在下文中一共展示了Template::pparse方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: afficher
function afficher()
{
$html = '';
if ($this->existe()) {
$t = new Template('modules/archi/templates/');
$t->set_filenames(array('afficherErreurs' => 'listeErreurs.tpl'));
foreach ($this->array_erreurs as $message) {
$t->assign_block_vars('erreur', array('message' => $message));
}
ob_start();
$t->pparse('afficherErreurs');
$html = ob_get_contents();
ob_get_clean();
}
return $html;
}
示例2: htmlentities
$t->set_file(array("add_forum" => "forum_add_forum.ihtml"));
$t->set_block("add_forum", "add", "DUMMY");
$t->set_block("add_forum", "no_access", "DUMMY");
$t->set_block("add_forum", "error", "DUMMY");
$t->set_block("add_forum", "error_title", "DUMMY");
$t->set_block("add_forum", "error_not_logged_in", "DUMMY");
$t->set_block("add_forum", "button_mission", "BUTTON_MISSION_ROW");
$t->set_block("add_forum", "button_label_save", "DUMMY");
$t->set_var(array("BUTTON_CANCEL_MISSION" => "close", "BUTTON_CANCEL_URL" => "", "BUTTON_MISSION_ROW" => "", "CURRENT_FORUM" => norm_post($attrib[OBJ_DESC]), "DUMMY" => "", "ERROR_TITLE" => "", "FORUM_ID" => $room_id, "ERROR_FEEDBACK" => "", "FORM_SUBTITLE" => norm_post($subtitle), "FORM_TITLE" => norm_post($title), "FORM_DESCRIPTION" => htmlentities($description), "BUTTON_URL" => "{$config_webserver_ip}/modules/forum/add_forum.php", "BUTTON_MISSION" => "save", "DO_LOGIN" => "0", "BODY_ON_LOAD" => "if (document.form_blueprint.title) document.form_blueprint.title.focus();"));
if ($do_login) {
$t->set_var(array("DO_LOGIN" => "1", "BODY_ON_LOAD" => "document.getElementById('form_blueprint').submit();"));
}
/*
* Error handling
*/
if (isset($messageboard) && !$messageboard->get_id()) {
$error[] = "error";
}
if (isset($_POST["title"]) && trim($_POST["title"]) == "") {
$error[] = "error_title";
}
//if action has been done and error occured put out error feedback
if ($action != "" && isset($error) && count($error) > 0) {
foreach ($error as $error_type) {
$t->parse("ERROR_FEEDBACK", $error_type, true);
}
}
$t->parse("BUTTON_LABEL", "button_label_save");
$t->parse("BUTTON_MISSION_ROW", "button_mission", true);
$t->pparse("OUT", "add_forum");
示例3: getallitem
//上级代号
}
$arrall[$a][name] = $temp_arr2[2];
//名称
$arrall[$a][pic] = $temp_arr2[3];
//图片
$arrall[$a][url] = $temp_arr2[4];
//连接地址
$arrall[$a][isunder] = $temp_arr2[5];
//是否最后一级
}
}
$show = getallitem(0, "");
$t->set_var("show", $show);
$t->set_var("skin", $loginskin);
$t->pparse("out", "left");
# 最后输出页面
function getallitem($fid, $emshow)
{
// 得出并显示所有的行
global $arrall;
global $n;
$arryget = getarry($fid);
// 得出本级的所有行
$show = "";
if (is_array($arryget)) {
$ncount = count($arryget);
for ($j = 0; $j < $ncount; $j++) {
$n++;
$usen = $n;
$a = $arryget[$j][code];
示例4:
// $template->debug = true;
$template->set_file('page', 'access.htt');
$template->set_block('page', 'main_block', 'main');
$template->set_block('main_block', 'users_block', 'user');
$template->set_block('main_block', 'groups_block', 'group');
// Insert values into the template object
$template->set_var(array('ADMIN_URL' => ADMIN_URL, 'THEME_URL' => THEME_URL, 'WB_URL' => WB_URL));
/**
* Insert permission values into the template object
* Deprecated - as we are using blocks.
*/
$display_none = "style=\"display: none;\"";
if ($admin->get_permission('users') != true) {
$template->set_var('DISPLAY_USERS', $display_none);
}
if ($admin->get_permission('groups') != true) {
$template->set_var('DISPLAY_GROUPS', $display_none);
}
// Insert section names and descriptions
$template->set_var(array('USERS' => $MENU['USERS'], 'GROUPS' => $MENU['GROUPS'], 'ACCESS' => $MENU['ACCESS'], 'USERS_OVERVIEW' => $OVERVIEW['USERS'], 'GROUPS_OVERVIEW' => $OVERVIEW['GROUPS']));
if ($admin->get_permission('users') == true) {
$template->parse('main_block', "users_block", true);
}
if ($admin->get_permission('groups') == true) {
$template->parse('main_block', "groups_block", true);
}
// Parse template object
$template->parse('main', 'main_block', false);
$template->pparse('output', 'page');
// Print admin footer
$admin->print_footer();
示例5: print_footer
public function print_footer($activateJsAdmin = false, $operateBuffer = true)
{
// include the required file for Javascript admin
if ($activateJsAdmin != false) {
if (file_exists(WB_PATH . '/modules/jsadmin/jsadmin_backend_include.php')) {
@(include_once WB_PATH . '/modules/jsadmin/jsadmin_backend_include.php');
}
}
// Setup template object, parse vars to it, then parse it
$footer_template = new Template(dirname($this->correct_theme_source('footer.htt')));
$footer_template->set_file('page', 'footer.htt');
$footer_template->set_block('page', 'footer_block', 'header');
$footer_template->set_var(array('WBCE_VERSION' => WBCE_VERSION, 'PHP_VERSION' => phpversion(), 'WBCE_TAG' => in_array(WBCE_TAG, array('', '-')) ? '-' : '<a href="https://github.com/WBCE/WebsiteBaker_CommunityEdition/releases/tag/' . WBCE_TAG . '" target="_blank">' . WBCE_TAG . '</a>', 'BACKEND_BODY_MODULE_JS' => $this->register_backend_modfiles_body('js'), 'WB_URL' => WB_URL, 'ADMIN_URL' => ADMIN_URL, 'THEME_URL' => THEME_URL));
$footer_template->parse('header', 'footer_block', false);
$footer_template->pparse('output', 'page');
if ($operateBuffer) {
// OPF dashboard
$allOutput = ob_get_clean();
if (function_exists('opf_controller')) {
$allOutput = opf_controller('backend', $allOutput);
}
// konventional output filter
if (!defined("WB_SUPPRESS_OLD_OPF") or !WB_SUPPRESS_OLD_OPF) {
// Module is installed, filter file in place?
$file = WB_PATH . '/modules/output_filter/filter_routines.php';
if (file_exists($file)) {
include_once $file;
if (function_exists('executeBackendOutputFilter')) {
$allOutput = executeBackendOutputFilter($allOutput);
}
}
}
echo $allOutput;
}
}
示例6: Template
<?php
//$thismenucode = "10n007";
require "../include/common.inc.php";
$db = new db_test();
$db2 = new db_test();
$db3 = new db_test();
$gotourl = $gourl . $tempurl;
$t = new Template(".", "keep");
$t->set_file("template", "authorpaycard_query.html");
$checkall = '<INPUT onclick=CheckAll(this) type=checkbox class=checkbox name=chkall>';
$arr_text = array("编号", "商户名", "刷卡器号码", "刷卡器类型", "刷卡器属性", "购买批次", "目前状态", "交易次数", "交易金额", "产生收益");
for ($i = 0; $i < count($arr_text); $i++) {
$theadth .= ' <th>' . $arr_text[$i] . '</th>';
}
echo $commid;
$t->set_var("theadth", $theadth);
$t->set_var("vid", $vid);
$t->set_var("action", $action);
$t->set_var("error", $error);
$t->set_var("gotourl", $gotourl);
// 转用的地址
// 判断权限
include "../include/checkqx.inc.php";
$t->set_var("skin", $loginskin);
$t->pparse("out", "template");
//最后输出界面
示例7: message_die
//.........这里部分代码省略.........
case GENERAL_MESSAGE:
if ( $msg_title == '' )
{
$msg_title = $lang['Information'];
}
break;
case CRITICAL_MESSAGE:
if ( $msg_title == '' )
{
$msg_title = $lang['Critical_Information'];
}
break;
case GENERAL_ERROR:
if ( $msg_text == '' )
{
$msg_text = $lang['An_error_occured'];
}
if ( $msg_title == '' )
{
$msg_title = $lang['General_Error'];
}
break;
case CRITICAL_ERROR:
//
// Critical errors mean we cannot rely on _ANY_ DB information being
// available so we're going to dump out a simple echo'd statement
//
include($phpbb_root_path . 'language/lang_english/lang_main.php');
if ( $msg_text == '' )
{
$msg_text = $lang['A_critical_error'];
}
if ( $msg_title == '' )
{
$msg_title = 'phpBB : <b>' . $lang['Critical_Error'] . '</b>';
}
break;
}
//
// Add on DEBUG info if we've enabled debug mode and this is an error. This
// prevents debug info being output for general messages should DEBUG be
// set TRUE by accident (preventing confusion for the end user!)
//
if ( DEBUG && ( $msg_code == GENERAL_ERROR || $msg_code == CRITICAL_ERROR ) )
{
if ( $debug_text != '' )
{
$msg_text = $msg_text . '<br /><br /><b><u>DEBUG MODE</u></b>' . $debug_text;
}
}
if ( $msg_code != CRITICAL_ERROR )
{
if ( !empty($lang[$msg_text]) )
{
$msg_text = $lang[$msg_text];
}
if ( !defined('IN_ADMIN') )
{
$template->set_filenames(array(
'message_body' => 'message_body.tpl')
);
}
else
{
$template->set_filenames(array(
'message_body' => 'admin/admin_message_body.tpl')
);
}
$template->assign_vars(array(
'MESSAGE_TITLE' => $msg_title,
'MESSAGE_TEXT' => $msg_text)
);
$template->pparse('message_body');
if ( !defined('IN_ADMIN') )
{
include($phpbb_root_path . 'includes/page_tail.php');
}
else
{
include($phpbb_root_path . 'admin/page_footer_admin.php');
}
}
else
{
echo "<html>\n<body>\n" . $msg_title . "\n<br /><br />\n" . $msg_text . "</body>\n</html>";
}
exit;
}
示例8: gmdate
$lastlogin = '-';
} else {
$lastlogin = gmdate(DATE_FORMAT . " " . TIME_FORMAT, $d['login_when'] + TIMEZONE);
}
$bgcol = $rowcnt++ % 2 == 0 ? '#EEE' : '#FFF';
$tpl->set_var('WB_URL', WB_URL);
$tpl->set_var('ADMIN_URL', ADMIN_URL);
$tpl->set_var('RESULT_EDIT_USER', $MOD_USER_SEARCH['EDIT_USER']);
$tpl->set_var('RESULT_ADMIN_DISABLED', $MOD_USER_SEARCH['ADMIN_DISABLED']);
$tpl->set_var('RESULT_BGCOL', $bgcol);
$tpl->set_var('RESULT_USER_ID', $d['user_id']);
$tpl->set_var('IDKEY_USER_ID', $admin->getIDKEY($d['user_id']));
$tpl->set_var('RESULT_USERNAME', $d['username']);
$tpl->set_var('RESULT_DISPLAYNAME', $d['display_name']);
$tpl->set_var('RESULT_EMAIL', $d['email']);
$tpl->set_var('RESULT_LASTLOGIN', $lastlogin);
$tpl->set_var('RESULT_DAYS_INACTIVE', $d['login_when'] == 0 ? '-' : round((time() - (int) $d['login_when']) / (3600 * 24)));
$tpl->set_var('RESULT_LAST_IP', $d['login_ip']);
// add template values in append mode (add per loop)
$tpl->parse('result_list_block_handle', 'result_list_block', true);
}
$tpl->set_var('HINT_EDIT', $MOD_USER_SEARCH['HINT_EDIT']);
// parse the final template block
$tpl->parse('result_table_block_handle', 'result_table_block');
}
$tpl->set_var('NEW_SEARCH', $MOD_USER_SEARCH['NEW_SEARCH']);
}
}
// ouput the final template
$tpl->pparse('output', 'page');
示例9:
}
$t->set_var($arr_allval);
$file = "mobilerecharge_list.php?1";
$ly = $ny = $year;
$last = $month - 1;
if ($last == 0) {
$last = 12;
$ly--;
}
$next = $month + 1;
if ($next == 13) {
$next = 1;
$ny++;
}
if ($ly >= 1901) {
$str_page .= "<a href=\"" . $file . "&year=" . $ly . "&month=" . $last . "\"><<上一月</a> \n";
} else {
$str_page .= "";
}
if ($ny <= 2020) {
$str_page .= "<a href=\"" . $file . "&year=" . $ny . "&month=" . $next . "\">下一月>></a>\n";
}
$allxjdunshu = number_format($allxjdunshu, 4, ".", "");
$t->set_var("str_page", $str_page);
$t->set_var("year", $year);
$t->set_var("month", $month);
$t->set_var("pagenav", $pagenav);
$t->set_var("brows_rows", $brows_rows);
$t->set_var("skin", $loginskin);
$t->pparse("out", "mobilerecharge_list");
# 最后输出页面
示例10:
// If no state is selected, preselect the shop state
if (!isset($cust_state) || $cust_state == '') {
$cust_state = $setting_shop_state;
}
if ((!isset($ship_state) || $ship_state == '') && $setting_shipping_form != 'none') {
$ship_state = $setting_shop_state;
}
// SHOW TITLE AND MESSAGES IF ANY
// ******************************
// Assign page filename for tracking with Google Analytics _trackPageview() function
global $ga_page;
$ga_page = '/view_form.php';
// Show form title using template file
$tpl->set_file('form_title', 'title.htm');
$tpl->set_var(array('WB_URL' => WB_URL, 'TXT_SUBMIT_ORDER' => $MOD_BAKERY['TXT_SUBMIT_ORDER'], 'TXT_ADDRESS' => $MOD_BAKERY['TXT_ADDRESS'], 'TXT_FILL_IN_ADDRESS' => $MOD_BAKERY['TXT_FILL_IN_ADDRESS'], 'SETTING_CONTINUE_URL' => $setting_continue_url));
$tpl->pparse('output', 'form_title');
// Show form error messages using template file
if (isset($form_error)) {
$tpl->set_file('form_error', 'error.htm');
$tpl->set_var(array('FORM_ERROR' => $form_error));
$tpl->pparse('output', 'form_error');
}
// SET FILE AND BLOCKS FOR FORM TEMPLATE
// *************************************
$tpl->set_file('form', 'form.htm');
$tpl->set_block('form', 'main_block', 'main');
$tpl->set_block('main_block', 'cust_country_block', 'cust_country');
$tpl->set_block('main_block', 'cust_state_block', 'cust_state');
$tpl->set_block('main_block', 'cust_textfields_block', 'cust_textfields');
$tpl->set_block('main_block', 'cust_button_block', 'cust_button');
$tpl->set_block('main_block', 'cust_buttons_block', 'cust_buttons');
示例11: Template
$content = $portlet_content;
//display stuff
$tpl = new Template("./templates/{$language}", "keep");
$tpl->set_file("content", "topic_edit.ihtml");
$tpl->set_block("content", "feedback_headline_null", "DUMMY");
$tpl->set_var(array("DUMMY" => "", "PORTAL_ID" => $portal->get_id(), "PORTAL_NAME" => $portal_name, "PORTLET_NAME" => $portlet_name, "PORTLET_ID" => $portlet->get_id(), "FEEDBACK" => "", "BUTTON_CANCEL_MISSION" => "", "BUTTON_CANCEL_URL" => "{$config_webserver_ip}/modules/portal2/portlets/topic/edit.php", "BUTTON_MISSION" => "save", "BUTTON_URL" => "{$config_webserver_ip}/modules/portal2/portlets/topic/topic_edit.php"));
//save stuff
if ($action == "save" && isset($content[$category])) {
$action = "save return(portlets/topic/edit.php)";
$new_content = array("title" => norm_post("title"), "description" => norm_post("description"), "link_url" => norm_post("link_url"), "link_target" => isset($_POST["link_target"]) ? "checked" : "");
if ($topic == "") {
$topic = array_push($content[$category]["topics"], $new_content) - 1;
} else {
$content[$category]["topics"][$topic] = $new_content;
}
//verify input
if ($_POST["title"] == "") {
$tpl->parse("FEEDBACK", "feedback_headline_null");
$action = "";
}
$portlet_content = $content;
}
//if new category then leave all empty
$tpl->set_var("CATEGORY_ID", $category);
if ($action == "new") {
$tpl->set_var(array("TOPIC_ID" => "", "TOPIC_TITLE" => "", "TOPIC_DESCRIPTION" => "", "TOPIC_LINK_URL" => "", "TOPIC_LINK_TARGET" => ""));
} else {
$tpl->set_var(array("TOPIC_ID" => $topic, "TOPIC_TITLE" => trim($content[$category]["topics"][$topic]["title"]), "TOPIC_DESCRIPTION" => trim($content[$category]["topics"][$topic]["description"]), "TOPIC_LINK_URL" => trim($content[$category]["topics"][$topic]["link_url"]), "TOPIC_LINK_TARGET" => trim($content[$category]["topics"][$topic]["link_target"])));
}
$tpl->pparse("OUT", "content");
include "../../footer.php";
示例12:
break;
}
if (empty($listid)) {
$action = "new";
} else {
$query = "select * from tb_arrive where fd_arrive_id='{$listid}'";
$db->query($query);
if ($db->nf()) {
$db->next_record();
$arriveid = $db->f(fd_arrive_id);
$arrivename = $db->f(fd_arrive_name);
$action = "edit";
}
}
$t->set_var("arriveid", $arriveid);
$t->set_var("listid", $listid);
$t->set_var("arrivename", $arrivename);
$t->set_var("arriverates", $arriverates);
$t->set_var("arrivebear", $arrivebear);
$t->set_var("error", $error);
$t->set_var("action", $action);
$t->set_var("gotourl", $gotourl);
// 转用的地址
// 判断权限
include "../include/checkqx.inc.php";
$t->set_var("skin", $loginskin);
$t->pparse("out", "arrive");
# 最后输出页面
?>
示例13: makeselect
}
}
$sdcr_citycode = makeselect($arr_city_name, $sdcr_citycode, $arr_city_code);
$arr_activeid = array("0", "1");
$arr_activename = array("否", "是");
$sdcr_active = makeselect($arr_activename, $sdcr_active, $arr_activeid);
$t->set_var("listid", $listid);
$t->set_var("sdcr_name", $sdcr_name);
$t->set_var("sdcr_merid", $sdcr_merid);
$t->set_var("sdcr_securitykey", $sdcr_securitykey);
$t->set_var("sdcr_provcode", $sdcr_provcode);
$t->set_var("agentfee", $agentfee);
$t->set_var("payfee", $payfee);
$t->set_var("minpayfee", $minpayfee);
$t->set_var("sdcr_provcode", $sdcr_provcode);
$t->set_var("sdcr_citycode", $sdcr_citycode);
$t->set_var("sdcr_active", $sdcr_active);
$t->set_var("tradeurl", $tradeurl);
$t->set_var("queryurl", $queryurl);
$t->set_var("action", $action);
$t->set_var("gotourl", $gotourl);
// 转用的地址
$t->set_var("error", $error);
// 判断权限
include "../include/checkqx.inc.php";
$t->set_var("skin", $loginskin);
$t->pparse("out", "sendcenter");
# 最后输出页面
?>
示例14:
default:
$paytype = "其他业务";
break;
}
$t->set_var("tijiao_dis", $tijiao_dis);
$t->set_var("listno", $listno);
$t->set_var("listid", $listid);
$t->set_var("dealwithman", $dealwithman);
$t->set_var("money", $money);
$t->set_var("date", $date);
$t->set_var("fkdate", $fkdate);
$t->set_var("memo_z", $memo_z);
$t->set_var("paytype", $paytype);
$t->set_var("count", $count);
$t->set_var("times", $times);
$t->set_var("isagentpay", $isagentpay);
$t->set_var("list_disabled", $list_disabled);
$t->set_var("all_paymoney", $all_paymoney);
$t->set_var("all_payfee", $all_payfee);
$t->set_var("all_money", $all_money);
$t->set_var("action", $action);
$t->set_var("gotourl", $gotourl);
// 转用的地址
$t->set_var("downloadurl", $downloadurl);
// 下载地址
$t->set_var("error", $error);
// 判断权限
include "../include/checkqx.inc.php";
$t->set_var("skin", $loginskin);
$t->pparse("out", "createfile");
# 最后输出页面
示例15:
$t->set_var("listid", $listid);
$t->set_var("telid", $telid);
$t->set_var("telname", $telname);
$t->set_var("intime", $intime);
$t->set_var("outtime", $outtime);
$t->set_var("errornum", $errornum);
$t->set_var("inip", $inip);
$t->set_var("memo", $memo);
$t->set_var("recsts", $recsts);
$t->set_var("isin", $isin);
$t->set_var("term", $term);
$t->set_var("checkterm", $checkterm);
$t->set_var("chgpass", $chgpass);
$t->set_var("staid", $staid);
$t->set_var("stano", $stano);
$t->set_var("staname", $staname);
$t->set_var("selgroup", $selgroup);
$t->set_var("partid", $partid);
$t->set_var("partname", $partname);
$t->set_var("area", $area);
$t->set_var("group", $group);
$t->set_var("state", $state);
$t->set_var("action", $action);
$t->set_var("gotourl", $gotourl);
// 转用的地址
$t->set_var("error", $error);
// 判断权限
include "../include/checkqx.inc.php";
$t->set_var("skin", $loginskin);
$t->pparse("out", "teller");
# 最后输出页面