本文整理汇总了PHP中TemplateEngine::processTemplate方法的典型用法代码示例。如果您正苦于以下问题:PHP TemplateEngine::processTemplate方法的具体用法?PHP TemplateEngine::processTemplate怎么用?PHP TemplateEngine::processTemplate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TemplateEngine
的用法示例。
在下文中一共展示了TemplateEngine::processTemplate方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _templateData
function _templateData($templateData, $dataArr = null, $sqlData = "", $tmplID = null, $editable = true)
{
if ($dataArr == null) {
$dataArr = array();
$dataArr["date"] = date(getConfig("PHP_DATE_FORMAT"));
$dataArr["time"] = date(getConfig("TIME_FORMAT"));
$dataArr["datetime"] = date(getConfig("PHP_DATE_FORMAT") . " " . getConfig("TIME_FORMAT"));
$dataArr["site"] = SITENAME;
if (isset($_REQUEST["page"])) {
$dataArr["page"] = $_REQUEST["page"];
} else {
$dataArr["page"] = "home";
}
if (isset($_SESSION["SESS_USER_ID"])) {
$dataArr["user"] = $_SESSION["SESS_USER_ID"];
} else {
$dataArr["user"] = "Guest";
}
if (isset($_SESSION["SESS_PRIVILEGE_ID"])) {
$dataArr["privilege"] = $_SESSION["SESS_PRIVILEGE_ID"];
} else {
$dataArr["privilege"] = "Guest";
}
if (isset($_SESSION["SESS_USER_NAME"])) {
$dataArr["username"] = $_SESSION["SESS_USER_NAME"];
} else {
$dataArr["user_name"] = "Guest";
}
if (isset($_SESSION["SESS_PRIVILEGE_NAME"])) {
$dataArr["privilegename"] = $_SESSION["SESS_PRIVILEGE_NAME"];
} else {
$dataArr["privilege_name"] = "Guest";
}
} else {
if (!isset($dataArr["date"])) {
$dataArr["date"] = date(getConfig("PHP_DATE_FORMAT"));
}
if (!isset($dataArr["time"])) {
$dataArr["time"] = date(getConfig("TIME_FORMAT"));
}
if (!isset($dataArr["datetime"])) {
$dataArr["datetime"] = date(getConfig("PHP_DATE_FORMAT") . " " . getConfig("TIME_FORMAT"));
}
if (!isset($dataArr["site"])) {
$dataArr["site"] = SITENAME;
}
if (!isset($dataArr["page"])) {
if (isset($_REQUEST["page"])) {
$dataArr["page"] = $_REQUEST["page"];
} else {
$dataArr["page"] = "home";
}
}
if (!isset($dataArr["user"])) {
if (isset($_SESSION["SESS_USER_ID"])) {
$dataArr["user"] = $_SESSION["SESS_USER_ID"];
} else {
$dataArr["user"] = "Guest";
}
}
if (!isset($dataArr["privilege"])) {
if (isset($_SESSION["SESS_PRIVILEGE_ID"])) {
$dataArr["privilege"] = $_SESSION["SESS_PRIVILEGE_ID"];
} else {
$dataArr["privilege"] = "Guest";
}
}
if (!isset($dataArr["username"])) {
if (isset($_SESSION["SESS_USER_NAME"])) {
$dataArr["username"] = $_SESSION["SESS_USER_NAME"];
} else {
$dataArr["user_name"] = "Guest";
}
}
if (!isset($dataArr["privilegename"])) {
if (isset($_SESSION["SESS_PRIVILEGE_NAME"])) {
$dataArr["privilegename"] = $_SESSION["SESS_PRIVILEGE_NAME"];
} else {
$dataArr["privilege_name"] = "Guest";
}
}
}
$body = TemplateEngine::processTemplate($templateData, $dataArr, $editable);
return $body;
}