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


PHP RenderingContextInterface::setControllerContext方法代码示例

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


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

示例1: controllerContextCanBeReadCorrectly

 /**
  * @test
  */
 public function controllerContextCanBeReadCorrectly()
 {
     $controllerContext = $this->getMock(\TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext::class, array('getRequest'), array(), '', false);
     $controllerContext->expects($this->atLeastOnce())->method('getRequest')->willReturn($this->getMock(Request::class));
     $this->renderingContext->setControllerContext($controllerContext);
     $this->assertSame($this->renderingContext->getControllerContext(), $controllerContext);
 }
开发者ID:TYPO3Incubator,项目名称:TYPO3.CMS,代码行数:10,代码来源:RenderingContextTest.php

示例2: render

 /**
  * Loads the template source and render the template.
  * If "layoutName" is set in a PostParseFacet callback, it will render the file with the given layout.
  *
  * @param string $actionName If set, the view of the specified action will be rendered instead. Default is the action specified in the Request object
  * @return string Rendered Template
  * @api
  */
 public function render($actionName = NULL)
 {
     $this->baseRenderingContext->setControllerContext($this->controllerContext);
     $this->templateParser->setConfiguration($this->buildParserConfiguration());
     $templateIdentifier = $this->getTemplateIdentifier($actionName);
     if ($this->templateCompiler->has($templateIdentifier)) {
         $parsedTemplate = $this->templateCompiler->get($templateIdentifier);
     } else {
         $parsedTemplate = $this->templateParser->parse($this->getTemplateSource($actionName));
         if ($parsedTemplate->isCompilable()) {
             $this->templateCompiler->store($templateIdentifier, $parsedTemplate);
         }
     }
     if ($parsedTemplate->hasLayout()) {
         $layoutName = $parsedTemplate->getLayoutName($this->baseRenderingContext);
         $layoutIdentifier = $this->getLayoutIdentifier($layoutName);
         if ($this->templateCompiler->has($layoutIdentifier)) {
             $parsedLayout = $this->templateCompiler->get($layoutIdentifier);
         } else {
             $parsedLayout = $this->templateParser->parse($this->getLayoutSource($layoutName));
             if ($parsedLayout->isCompilable()) {
                 $this->templateCompiler->store($layoutIdentifier, $parsedLayout);
             }
         }
         $this->startRendering(self::RENDERING_LAYOUT, $parsedTemplate, $this->baseRenderingContext);
         $output = $parsedLayout->render($this->baseRenderingContext);
         $this->stopRendering();
     } else {
         $this->startRendering(self::RENDERING_TEMPLATE, $parsedTemplate, $this->baseRenderingContext);
         $output = $parsedTemplate->render($this->baseRenderingContext);
         $this->stopRendering();
     }
     return $output;
 }
开发者ID:khanhdeux,项目名称:typo3test,代码行数:42,代码来源:AbstractTemplateView.php

示例3: prepareContextsForUncachedRendering

 /**
  * @param \TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext
  * @param \TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext $controllerContext
  * @return void
  */
 protected function prepareContextsForUncachedRendering(RenderingContextInterface $renderingContext, ControllerContext $controllerContext)
 {
     $renderingContext->setControllerContext($controllerContext);
     $this->setRenderingContext($renderingContext);
     $this->templateParser = TemplateParserBuilder::build();
     $this->templateCompiler = $this->objectManager->get('TYPO3\\CMS\\Fluid\\Core\\Compiler\\TemplateCompiler');
     $this->templateCompiler->setTemplateCache($GLOBALS['typo3CacheManager']->getCache('fluid_template'));
 }
开发者ID:chrmue01,项目名称:typo3-starter-kit,代码行数:13,代码来源:UncacheTemplateView.php

示例4: controllerContextCanBeReadCorrectly

 /**
  * @test
  */
 public function controllerContextCanBeReadCorrectly()
 {
     $controllerContext = $this->getMock('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\ControllerContext', array(), array(), '', FALSE);
     $this->renderingContext->setControllerContext($controllerContext);
     $this->assertSame($this->renderingContext->getControllerContext(), $controllerContext);
 }
开发者ID:khanhdeux,项目名称:typo3test,代码行数:9,代码来源:RenderingContextTest.php

示例5: controllerContextCanBeReadCorrectly

 /**
  * @test
  */
 public function controllerContextCanBeReadCorrectly()
 {
     $controllerContext = $this->getMock(\TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext::class, array(), array(), '', false);
     $this->renderingContext->setControllerContext($controllerContext);
     $this->assertSame($this->renderingContext->getControllerContext(), $controllerContext);
 }
开发者ID:rickymathew,项目名称:TYPO3.CMS,代码行数:9,代码来源:RenderingContextTest.php


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