本文整理汇总了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 {
//.........这里部分代码省略.........