本文整理匯總了PHP中eZTemplateCompiler::processNodeTransformationChild方法的典型用法代碼示例。如果您正苦於以下問題:PHP eZTemplateCompiler::processNodeTransformationChild方法的具體用法?PHP eZTemplateCompiler::processNodeTransformationChild怎麽用?PHP eZTemplateCompiler::processNodeTransformationChild使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類eZTemplateCompiler
的用法示例。
在下文中一共展示了eZTemplateCompiler::processNodeTransformationChild方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: processNodeTransformationChild
static function processNodeTransformationChild($useComments, $php, $tpl, &$node, &$resourceData)
{
$nodeType = $node[0];
if ($nodeType == eZTemplate::NODE_FUNCTION) {
$nodeCopy = $node;
$functionChildren = $node[1];
$functionName = $node[2];
$functionParameters = $node[3];
$functionPlacement = $node[4];
if (!isset($tpl->Functions[$functionName])) {
return false;
}
if (is_array($tpl->Functions[$functionName])) {
$tpl->loadAndRegisterFunctions($tpl->Functions[$functionName]);
}
$functionObject =& $tpl->Functions[$functionName];
if (is_object($functionObject)) {
$hasTransformationSupport = false;
$transformChildren = true;
$transformParameters = false;
if (method_exists($functionObject, 'functionTemplateHints')) {
$hints = $functionObject->functionTemplateHints();
if (isset($hints[$functionName]) and isset($hints[$functionName]['tree-transformation']) and $hints[$functionName]['tree-transformation']) {
$hasTransformationSupport = true;
}
if (isset($hints[$functionName]) and isset($hints[$functionName]['transform-children'])) {
$transformChildren = $hints[$functionName]['transform-children'];
}
if (isset($hints[$functionName]) and isset($hints[$functionName]['transform-parameters'])) {
$transformParameters = $hints[$functionName]['transform-parameters'];
}
}
if ($hasTransformationSupport and method_exists($functionObject, 'templateNodeTransformation')) {
if ($transformChildren and $functionChildren) {
$newChildren = array();
foreach ($functionChildren as $childNode) {
$newChildNode = eZTemplateCompiler::processNodeTransformationChild($useComments, $php, $tpl, $childNode, $resourceData);
if (!$newChildNode) {
$newChildren[] = $childNode;
} else {
if (!is_array($newChildNode)) {
$newChildren[] = $newChildNode;
} else {
$newChildren = array_merge($newChildren, $newChildNode);
}
}
}
if (count($newChildren) > 0) {
$node[1] = $newChildren;
}
}
if ($transformParameters and $functionParameters) {
$newParameters = array();
foreach ($functionParameters as $parameterName => $parameterElementList) {
$elementTree = $parameterElementList;
$elementList = $elementTree;
$newParamNode = eZTemplateCompiler::processElementTransformationChild($useComments, $php, $tpl, $node, $elementTree, $elementList, $resourceData);
if (!$newParamNode || !is_array($newParamNode)) {
$newParameters[$parameterName] = $parameterElementList;
} else {
$newParameters[$parameterName] = $newParamNode;
}
}
if (count($newParameters) > 0) {
$node[3] = $newParameters;
$functionParameters = $newParameters;
}
}
$privateData = array('use-comments' => $useComments, 'php-creator' => $php, 'resource-data' => &$resourceData);
$newNodes = $functionObject->templateNodeTransformation($functionName, $node, $tpl, $functionParameters, $privateData);
unset($privateData);
if (!$newNodes) {
$node = $nodeCopy;
$node[1] = $functionChildren;
return false;
return $node;
}
return $newNodes;
}
} else {
if ($resourceData['test-compile']) {
$tpl->warning('', "Function '{$functionName}' is not registered.", $functionPlacement);
}
}
return false;
} else {
if ($nodeType == eZTemplate::NODE_VARIABLE) {
$elementTree = $node[2];
$elementList = $elementTree;
$newParameterElements = eZTemplateCompiler::processElementTransformationChild($useComments, $php, $tpl, $node, $elementTree, $elementList, $resourceData);
if ($newParameterElements) {
$newNode = $node;
$newNode[2] = $newParameterElements;
$newNodes = array($newNode);
return $newNodes;
}
} else {
if ($nodeType == eZTemplate::NODE_ROOT) {
return eZTemplateCompiler::processNodeTransformationRoot($useComments, $php, $tpl, $node, $resourceData);
} else {
//.........這裏部分代碼省略.........