本文整理汇总了PHP中TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer::getData方法的典型用法代码示例。如果您正苦于以下问题:PHP ContentObjectRenderer::getData方法的具体用法?PHP ContentObjectRenderer::getData怎么用?PHP ContentObjectRenderer::getData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer
的用法示例。
在下文中一共展示了ContentObjectRenderer::getData方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getDataWithTypeDebugPage
/**
* Checks if getData() works with type "data:page"
*
* @test
*/
public function getDataWithTypeDebugPage()
{
$uid = rand();
$GLOBALS['TSFE']->page = array('uid' => $uid);
$expectedResult = 'array(1item)uid=>' . $uid . '(integer)';
$result = $this->subject->getData('debug:page');
$cleanedResult = strip_tags($result);
$cleanedResult = str_replace("\r", '', $cleanedResult);
$cleanedResult = str_replace("\n", '', $cleanedResult);
$cleanedResult = str_replace("\t", '', $cleanedResult);
$cleanedResult = str_replace(' ', '', $cleanedResult);
$this->assertEquals($expectedResult, $cleanedResult);
}
示例2: process
/**
* Process content object data
*
* @param ContentObjectRenderer $cObj The data of the content element or page
* @param array $contentObjectConfiguration The configuration of Content Object
* @param array $processorConfiguration The configuration of this processor
* @param array $processedData Key/value store of processed data (e.g. to be passed to a Fluid View)
* @return array the processed data as key/value store
*/
public function process(ContentObjectRenderer $cObj, array $contentObjectConfiguration, array $processorConfiguration, array $processedData)
{
$siteRootPageId = $cObj->getData('leveluid:0');
$processedData['siteRootPageId'] = $siteRootPageId;
return $processedData;
}
示例3: getCurrentTable
/**
* Check if extension detail view or page properties should be used
*
* @param $tables
* @param \TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer $cObj
* @param bool $checkOnly
* @return array|bool
*/
public static function getCurrentTable($tables, $cObj, $checkOnly = false)
{
foreach ($tables as $key => $table) {
if (isset($tables[$key . '.']['enable'])) {
$settings = $tables[$key . '.'];
$uid = intval($cObj->getData($settings['enable']));
if ($uid) {
if ($checkOnly) {
return true;
}
$data = array('table' => $table, 'uid' => $uid);
if (isset($settings['fallback.']) && count($settings['fallback.']) > 0) {
$data['fallback'] = $settings['fallback.'];
}
return $data;
}
}
}
// page
$pagesTable = $GLOBALS['TSFE']->sys_language_uid > 0 ? 'pages_language_overlay' : 'pages';
if (in_array($pagesTable, $tables)) {
$pageUid = $GLOBALS['TSFE']->page['_PAGES_OVERLAY_UID'] ?: $GLOBALS['TSFE']->id;
return array($pagesTable, $pageUid);
}
return false;
}