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


PHP TemplateEngine::processTemplate方法代码示例

本文整理汇总了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;
 }
开发者ID:logiks,项目名称:logiks-core,代码行数:85,代码来源:boot.php


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