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


PHP eZTemplateCompiler::currentTextName方法代碼示例

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


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

示例1: generatePHPCodeChildren

    static function generatePHPCodeChildren($useComments, $php, $tpl, &$nodeChildren, &$resourceData, &$parameters, $currentParameters)
    {
        foreach ($nodeChildren as $node) {
            $newNode = false;
            $nodeType = $node[0];
            if ($nodeType > eZTemplate::NODE_USER_CUSTOM) {
                // Do custom nodes
            } else {
                if ($nodeType > eZTemplate::NODE_INTERNAL) {
                    // Do custom internal nodes
                    if ($nodeType == eZTemplate::NODE_INTERNAL_CODE_PIECE) {
                        $codePiece = $node[1];
                        $spacing = $currentParameters['spacing'];
                        if (isset($node[2]['spacing'])) {
                            $spacing += $node[2]['spacing'];
                        }
                        $php->addCodePiece($codePiece, array('spacing' => $spacing));
                    } else {
                        if ($nodeType == eZTemplate::NODE_INTERNAL_WARNING) {
                            $warningText = $php->thisVariableText($node[1], 23, 0, false);
                            $warningLabel = false;
                            $warningLabelText = '';
                            if (isset($node[2])) {
                                $warningLabelText = $php->thisVariableText($node[2], 0, 0, false);
                            }
                            $spacing = $currentParameters['spacing'];
                            if (isset($node[3]['spacing'])) {
                                $spacing += $node[3]['spacing'];
                            }
                            $placementText = 'false';
                            if (isset($node[4])) {
                                $placementText = $php->thisVariableText($node[4], 0, 0, false);
                            }
                            $php->addCodePiece("\$tpl->warning( " . $warningLabelText . ", " . $warningText . ", " . $placementText . " );", array('spacing' => $spacing));
                        } else {
                            if ($nodeType == eZTemplate::NODE_INTERNAL_ERROR) {
                                $errorText = $php->thisVariableText($node[1], 21, 0, false);
                                $errorLabel = false;
                                $errorLabelText = '';
                                if (isset($node[2])) {
                                    $errorLabelText = $php->thisVariableText($node[2], 0, 0, false);
                                }
                                $spacing = $currentParameters['spacing'];
                                if (isset($node[3]['spacing'])) {
                                    $spacing += $node[3]['spacing'];
                                }
                                $placementText = 'false';
                                if (isset($node[4])) {
                                    $placementText = $php->thisVariableText($node[4], 0, 0, false);
                                }
                                $php->addCodePiece("\$tpl->error( " . $errorLabelText . ", " . $errorText . ", " . $placementText . " );", array('spacing' => $spacing));
                            } else {
                                if ($nodeType == eZTemplate::NODE_INTERNAL_OUTPUT_READ) {
                                    $variableName = $node[1];
                                    $spacing = $currentParameters['spacing'];
                                    if (isset($node[2]['spacing'])) {
                                        $spacing += $node[2]['spacing'];
                                    }
                                    $textName = eZTemplateCompiler::currentTextName($parameters);
                                    $assignmentType = $node[3];
                                    $assignmentText = $php->variableNameText($variableName, $assignmentType, $node[2]);
                                    $php->addCodePiece("{$assignmentText}\${$textName};", array('spacing' => $spacing));
                                } else {
                                    if ($nodeType == eZTemplate::NODE_INTERNAL_OUTPUT_ASSIGN) {
                                        $variableName = $node[1];
                                        $spacing = $currentParameters['spacing'];
                                        if (isset($node[2]['spacing'])) {
                                            $spacing += $node[2]['spacing'];
                                        }
                                        $textName = eZTemplateCompiler::currentTextName($parameters);
                                        $assignmentType = $node[3];
                                        $assignmentText = $php->variableNameText($textName, $assignmentType, $node[2]);
                                        $php->addCodePiece("{$assignmentText}\${$variableName};", array('spacing' => $spacing));
                                    } else {
                                        if ($nodeType == eZTemplate::NODE_INTERNAL_OUTPUT_INCREASE) {
                                            $spacing = $currentParameters['spacing'];
                                            if (isset($node[1]['spacing'])) {
                                                $spacing += $node[1]['spacing'];
                                            }
                                            $textName = eZTemplateCompiler::currentTextName($parameters);
                                            $php->addCodePiece("if " . ($resourceData['use-comments'] ? "/*TC:" . __LINE__ . "*/" : "") . "( !isset( \$textStack ) )\n" . "    \$textStack = array();\n" . "\$textStack[] = \${$textName};\n" . "\${$textName} = '';", array('spacing' => $spacing));
                                        } else {
                                            if ($nodeType == eZTemplate::NODE_INTERNAL_OUTPUT_DECREASE) {
                                                $spacing = $currentParameters['spacing'];
                                                if (isset($node[1]['spacing'])) {
                                                    $spacing += $node[1]['spacing'];
                                                }
                                                $textName = eZTemplateCompiler::currentTextName($parameters);
                                                $php->addCodePiece("\${$textName} = array_pop( \$textStack );", array('spacing' => $spacing));
                                            } else {
                                                if ($nodeType == eZTemplate::NODE_INTERNAL_OUTPUT_SPACING_INCREASE) {
                                                    $spacing = $node[1];
                                                    $currentParameters['spacing'] += $spacing;
                                                    continue;
                                                } else {
                                                    if ($nodeType == eZTemplate::NODE_INTERNAL_SPACING_DECREASE) {
                                                        $spacing = $node[1];
                                                        $currentParameters['spacing'] -= $spacing;
                                                        continue;
                                                    } else {
//.........這裏部分代碼省略.........
開發者ID:runelangseid,項目名稱:ezpublish,代碼行數:101,代碼來源:eztemplatecompiler.php


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