当前位置: 首页>>代码示例>>PHP>>正文


PHP ContentObjectRenderer::getData方法代码示例

本文整理汇总了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);
 }
开发者ID:TYPO3Incubator,项目名称:TYPO3.CMS,代码行数:18,代码来源:ContentObjectRendererTest.php

示例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;
 }
开发者ID:svenhartmann,项目名称:vantomas,代码行数:15,代码来源:SiteRootPageId.php

示例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;
 }
开发者ID:clickstorm,项目名称:cs_seo,代码行数:34,代码来源:HeaderData.php


注:本文中的TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer::getData方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。