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


PHP ConfigurationManagerInterface::setContentObject方法代码示例

本文整理汇总了PHP中TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::setContentObject方法的典型用法代码示例。如果您正苦于以下问题:PHP ConfigurationManagerInterface::setContentObject方法的具体用法?PHP ConfigurationManagerInterface::setContentObject怎么用?PHP ConfigurationManagerInterface::setContentObject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface的用法示例。


在下文中一共展示了ConfigurationManagerInterface::setContentObject方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: initialize

 /**
  * Initializes configuration manager, object container and reflection service
  *
  * @param array $configuration
  * @return void
  */
 protected function initialize(array $configuration)
 {
     // initialize unconsumed Request and Response
     $this->request = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Mvc\\Cli\\Request');
     $this->response = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Mvc\\Cli\\Response');
     // initialize configuration
     $this->configurationManager->setContentObject(\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Frontend\\ContentObject\\ContentObjectRenderer'));
     $this->configurationManager->setConfiguration($configuration);
     // configure object container
     $frameworkConfiguration = $this->configurationManager->getConfiguration(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK);
     if (isset($frameworkConfiguration['objects'])) {
         $objectContainer = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\Container\\Container');
         foreach ($frameworkConfiguration['objects'] as $classNameWithDot => $classConfiguration) {
             if (isset($classConfiguration['className'])) {
                 $originalClassName = rtrim($classNameWithDot, '.');
                 $objectContainer->registerImplementation($originalClassName, $classConfiguration['className']);
             }
         }
     }
     // initialize reflection
     $reflectionService = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Reflection\\ReflectionService');
     $reflectionService->setDataCache(\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Cache\\CacheManager')->getCache('extbase_reflection'));
     if (!$reflectionService->isInitialized()) {
         $reflectionService->initialize();
     }
 }
开发者ID:khanhdeux,项目名称:typo3test,代码行数:32,代码来源:TaskExecutor.php

示例2: initializeEnvironment

 protected function initializeEnvironment()
 {
     /**
      * @var ConfigurationManager $configurationManager
      * @var ContentObjectRenderer $contentObjectRenderer
      */
     $this->objectManager = GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager');
     $configurationManager = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManager');
     $this->configurationManager =& $configurationManager;
     $contentObjectRenderer = GeneralUtility::makeInstance('TYPO3\\CMS\\Frontend\\ContentObject\\ContentObjectRenderer');
     $this->configurationManager->setContentObject($contentObjectRenderer);
     $this->uriBuilder = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Mvc\\Web\\Routing\\UriBuilder');
     if (empty($GLOBALS['TSFE']->sys_page)) {
         $GLOBALS['TSFE']->sys_page = GeneralUtility::makeInstance('TYPO3\\CMS\\Frontend\\Page\\PageRepository');
     }
     if (empty($GLOBALS['TSFE']->tmpl)) {
         $GLOBALS['TSFE']->initTemplate();
     }
     if (!isset($GLOBALS['TSFE']->config)) {
         $GLOBALS['TSFE']->config = array();
     }
     if (empty($GLOBALS['TSFE']->config['config'])) {
         $GLOBALS['TSFE']->config['config'] = array();
         $GLOBALS['TSFE']->config['config']['tx_realurl_enable'] = TRUE;
         $GLOBALS['TSFE']->config['mainScript'] = 'index.php';
     }
 }
开发者ID:jousch,项目名称:TYPO3.base,代码行数:27,代码来源:PageNotFoundHandling.php

示例3: initializeConfiguration

 /**
  * Initializes the Object framework.
  *
  * @param array $configuration
  * @return void
  * @see initialize()
  */
 public function initializeConfiguration($configuration)
 {
     $this->configurationManager = $this->objectManager->get(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::class);
     /** @var \TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer $contentObject */
     $contentObject = isset($this->cObj) ? $this->cObj : \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer::class);
     $this->configurationManager->setContentObject($contentObject);
     $this->configurationManager->setConfiguration($configuration);
 }
开发者ID:TYPO3Incubator,项目名称:TYPO3.CMS,代码行数:15,代码来源:Bootstrap.php

示例4: renderPreviewSection

 /**
  * @param ProviderInterface $provider
  * @param array $row
  * @param Form $form
  * @return string|NULL
  */
 protected function renderPreviewSection(ProviderInterface $provider, array $row, Form $form = NULL)
 {
     $templatePathAndFilename = $provider->getTemplatePathAndFilename($row);
     if (NULL === $templatePathAndFilename) {
         return NULL;
     }
     $extensionKey = $provider->getExtensionKey($row);
     $paths = $provider->getTemplatePaths($row);
     $flexformVariables = $provider->getFlexFormValues($row);
     $templateVariables = $provider->getTemplateVariables($row);
     $variables = RecursiveArrayUtility::merge($templateVariables, $flexformVariables);
     $variables['row'] = $row;
     $variables['record'] = $row;
     if (TRUE === is_object($form)) {
         $formLabel = $form->getLabel();
         $label = LocalizationUtility::translate($formLabel, $extensionKey);
         $variables['label'] = $label;
     }
     $templatePaths = new TemplatePaths($paths);
     $viewContext = new ViewContext($templatePathAndFilename, $extensionKey, self::CONTROLLER_NAME);
     $viewContext->setTemplatePaths($templatePaths);
     $viewContext->setVariables($variables);
     $view = $this->configurationService->getPreparedExposedTemplateView($viewContext);
     $existingContentObject = $this->configurationManager->getContentObject();
     $contentObject = new ContentObjectRenderer();
     $contentObject->start($row, $provider->getTableName($row));
     $this->configurationManager->setContentObject($contentObject);
     $previewContent = $view->renderStandaloneSection(self::PREVIEW_SECTION, $variables, TRUE);
     $this->configurationManager->setContentObject($existingContentObject);
     $previewContent = trim($previewContent);
     return $previewContent;
 }
开发者ID:busynoggin,项目名称:flux,代码行数:38,代码来源:PreviewView.php

示例5: initializeExtbaseFramework

 /**
  * @return void
  */
 protected function initializeExtbaseFramework()
 {
     // initialize cache manager
     $this->cacheManager = $GLOBALS['typo3CacheManager'];
     // inject content object into the configuration manager
     $this->configurationManager = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManagerInterface');
     $contentObject = GeneralUtility::makeInstance('TYPO3\\CMS\\Frontend\\ContentObject\\ContentObjectRenderer');
     $this->configurationManager->setContentObject($contentObject);
     $this->typoScriptService->makeTypoScriptBackup();
     // load extbase typoscript
     TypoScriptService::loadTypoScriptFromFile('EXT:extbase/ext_typoscript_setup.txt');
     TypoScriptService::loadTypoScriptFromFile('EXT:ap_ldap_auth/ext_typoscript_setup.txt');
     $this->configurationManager->setConfiguration($GLOBALS['TSFE']->tmpl->setup);
     $this->configureObjectManager();
     // initialize reflection
     $this->reflectionService = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Reflection\\ReflectionService');
     $this->reflectionService->setDataCache($this->cacheManager->getCache('extbase_reflection'));
     if (!$this->reflectionService->isInitialized()) {
         $this->reflectionService->initialize();
     }
     // initialize persistence
     $this->persistenceManager = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\PersistenceManager');
 }
开发者ID:LiaraAlis,项目名称:typo3-ap_ldap_auth,代码行数:26,代码来源:AbstractAuthenticationService.php

示例6: getPreview

 /**
  * Get preview chunks - header and content - as
  * array(string $headerContent, string $previewContent, boolean $continueRendering)
  *
  * Default implementation renders the Preview section from the template
  * file that the actual Provider returns for $row, using paths also
  * determined by $row. Example: fluidcontent's Provider returns files
  * and paths based on selected "Fluid Content type" and inherits and
  * uses this method to render a Preview from the template file in the
  * specific path. This default implementation expects the TYPO3 core
  * to render the default header, so it returns NULL as $headerContent.
  *
  * @param array $row The record data to be analysed for variables to use in a rendered preview
  * @return array
  */
 public function getPreview(array $row)
 {
     $templateSource = $this->getTemplateSource($row);
     if (TRUE === empty($templateSource)) {
         return array(NULL, NULL, TRUE);
     }
     $extensionKey = $this->getExtensionKey($row);
     $flexformVariables = $this->getFlexFormValues($row);
     $templateVariables = $this->getTemplateVariables($row);
     $variables = RecursiveArrayUtility::merge($templateVariables, $flexformVariables);
     $paths = $this->getTemplatePaths($row);
     $form = $this->getForm($row);
     $formLabel = $form->getLabel();
     $label = LocalizationUtility::translate($formLabel, $extensionKey);
     $variables['label'] = $label;
     $variables['row'] = $row;
     $variables['record'] = $row;
     $view = $this->configurationService->getPreparedExposedTemplateView($extensionKey, 'Content', $paths, $variables);
     $view->setTemplateSource($templateSource);
     $existingContentObject = $this->configurationManager->getContentObject();
     $contentObject = new ContentObjectRenderer();
     $contentObject->start($row, $this->getTableName($row));
     $this->configurationManager->setContentObject($contentObject);
     $previewContent = $view->renderStandaloneSection('Preview', $variables);
     $this->configurationManager->setContentObject($existingContentObject);
     $previewContent = trim($previewContent);
     $headerContent = NULL;
     return array($headerContent, $previewContent, empty($previewContent));
 }
开发者ID:samuweiss,项目名称:TYPO3-Site,代码行数:44,代码来源:AbstractProvider.php


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