當前位置: 首頁>>代碼示例>>PHP>>正文


PHP eZTemplateCompiler::processStaticOptimizations方法代碼示例

本文整理匯總了PHP中eZTemplateCompiler::processStaticOptimizations方法的典型用法代碼示例。如果您正苦於以下問題:PHP eZTemplateCompiler::processStaticOptimizations方法的具體用法?PHP eZTemplateCompiler::processStaticOptimizations怎麽用?PHP eZTemplateCompiler::processStaticOptimizations使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在eZTemplateCompiler的用法示例。


在下文中一共展示了eZTemplateCompiler::processStaticOptimizations方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: processStaticOptimizations

 static function processStaticOptimizations($useComments, $php, $tpl, &$node, &$resourceData, &$newNode)
 {
     $nodeType = $node[0];
     if ($nodeType == eZTemplate::NODE_ROOT) {
         $children = $node[1];
         $newNode[0] = $nodeType;
         $newNode[1] = false;
         if ($children) {
             $newNode[1] = array();
             foreach ($children as $child) {
                 $newChild = array();
                 eZTemplateCompiler::processStaticOptimizations($useComments, $php, $tpl, $child, $resourceData, $newChild);
                 $newNode[1][] = $newChild;
             }
         }
     } else {
         if ($nodeType == eZTemplate::NODE_TEXT) {
             $text = $node[2];
             $placement = $node[3];
             $newNode[0] = $nodeType;
             $newNode[1] = false;
             $newNode[2] = $text;
             $newNode[3] = $placement;
         } else {
             if ($nodeType == eZTemplate::NODE_VARIABLE) {
                 $variableCustom = $node[1];
                 $variableData = $node[2];
                 $variablePlacement = $node[3];
                 $dataInspection = eZTemplateCompiler::inspectVariableData($tpl, $variableData, $variablePlacement, $resourceData);
                 if (isset($dataInspection['new-data'])) {
                     $variableData = $dataInspection['new-data'];
                 }
                 $newNode = $node;
                 $newNode[1] = $variableCustom;
                 $newNode[2] = $variableData;
                 unset($dataInspection);
             } else {
                 if ($nodeType == eZTemplate::NODE_FUNCTION) {
                     $functionChildren = $node[1];
                     $functionName = $node[2];
                     $functionParameters = $node[3];
                     $functionPlacement = $node[4];
                     $newFunctionChildren = array();
                     if (is_array($functionChildren)) {
                         foreach ($functionChildren as $functionChild) {
                             $newChild = array();
                             eZTemplateCompiler::processStaticOptimizations($useComments, $php, $tpl, $functionChild, $resourceData, $newChild);
                             $newFunctionChildren[] = $newChild;
                         }
                         $functionChildren = $newFunctionChildren;
                     }
                     $newFunctionParameters = array();
                     if ($functionParameters) {
                         foreach ($functionParameters as $functionParameterName => $functionParameterData) {
                             $dataInspection = eZTemplateCompiler::inspectVariableData($tpl, $functionParameterData, false, $resourceData);
                             if (isset($dataInspection['new-data'])) {
                                 $functionParameterData = $dataInspection['new-data'];
                             }
                             $newFunctionParameters[$functionParameterName] = $functionParameterData;
                         }
                         $functionParameters = $newFunctionParameters;
                     }
                     $newNode[0] = $nodeType;
                     $newNode[1] = $functionChildren;
                     $newNode[2] = $functionName;
                     $newNode[3] = $functionParameters;
                     $newNode[4] = $functionPlacement;
                     if (isset($node[5])) {
                         $newNode[5] = $node[5];
                     }
                 } else {
                     $newNode = $node;
                 }
             }
         }
     }
 }
開發者ID:runelangseid,項目名稱:ezpublish,代碼行數:77,代碼來源:eztemplatecompiler.php


注:本文中的eZTemplateCompiler::processStaticOptimizations方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。