本文整理汇总了PHP中TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer::COBJ_ARRAY方法的典型用法代码示例。如果您正苦于以下问题:PHP ContentObjectRenderer::COBJ_ARRAY方法的具体用法?PHP ContentObjectRenderer::COBJ_ARRAY怎么用?PHP ContentObjectRenderer::COBJ_ARRAY使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer
的用法示例。
在下文中一共展示了ContentObjectRenderer::COBJ_ARRAY方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: cObjGetSingleExt
/**
* Renders the application defined cObject FORM
* which overrides the TYPO3 default cObject FORM
*
* First we make a COA_INT out of it, because it does not need to be cached
* Then we send a FORM_INT to the COA_INT
* When this is read, it will call the FORM class again.
*
* It simply calls execute because this function name is not really descriptive
* but is needed by the core of TYPO3
*
* @param string $typoScriptObjectName Name of the object
* @param array $typoScript TS configuration for this cObject
* @param string $typoScriptKey A string label used for the internal debugging tracking.
* @param \TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer $contentObject reference
* @return string HTML output
*/
public function cObjGetSingleExt($typoScriptObjectName, array $typoScript, $typoScriptKey, \TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer $contentObject)
{
$content = '';
if ($typoScriptObjectName === 'FORM' && !empty($typoScript['useDefaultContentObject'])) {
$content = $contentObject->getContentObject($typoScriptObjectName)->render($typoScript);
} elseif ($typoScriptObjectName === 'FORM') {
if ($contentObject->data['CType'] === 'mailform') {
$bodytext = $contentObject->data['bodytext'];
/** @var $typoScriptParser \TYPO3\CMS\Core\TypoScript\Parser\TypoScriptParser */
$typoScriptParser = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\TypoScript\\Parser\\TypoScriptParser');
$typoScriptParser->parse($bodytext);
$mergedTypoScript = (array) $typoScriptParser->setup;
\TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule($mergedTypoScript, (array) $typoScript);
// Disables content elements since TypoScript is handled that could contain insecure settings:
$mergedTypoScript[\TYPO3\CMS\Form\Domain\Factory\TypoScriptFactory::PROPERTY_DisableContentElement] = TRUE;
}
$newTypoScript = array('10' => 'FORM_INT', '10.' => is_array($mergedTypoScript) ? $mergedTypoScript : $typoScript);
$content = $contentObject->COBJ_ARRAY($newTypoScript, 'INT');
// Only apply stdWrap to TypoScript that was NOT created by the wizard:
if (isset($typoScript['stdWrap.'])) {
$content = $contentObject->stdWrap($content, $typoScript['stdWrap.']);
}
} elseif ($typoScriptObjectName === 'FORM_INT') {
$this->initialize($typoScript);
$content = $this->execute();
}
return $content;
}