Recursively loads all Fusion files from the configured path (By default that's Resources/Private/TypoScripts of the current package) and then checks whether a Fusion object for current controller and action can be found. If the controller class name is Foo\Bar\Baz\Controller\BlahController and the action is "index", it checks for the Fusion path Foo.Bar.Baz.BlahController.index. If this path is found, then it is used for rendering. Otherwise, the $fallbackView is used.
Inheritance: extends Neos\Flow\Mvc\View\AbstractView
 /**
  * Initialize the Fusion View
  *
  * @return void
  */
 protected function initializeFusionView()
 {
     $this->typoScriptView = new FusionView();
     $this->typoScriptView->setControllerContext($this->controllerContext);
     $this->typoScriptView->disableFallbackView();
     if ($this->hasArgument('typoScriptFilePathPattern')) {
         $this->typoScriptView->setTypoScriptPathPattern($this->arguments['typoScriptFilePathPattern']);
     }
 }
 /**
  * Helper to build a Fusion view object
  *
  * @return FusionView
  */
 protected function buildView()
 {
     $view = new FusionView();
     $httpRequest = Request::createFromEnvironment();
     $request = $httpRequest->createActionRequest();
     $uriBuilder = new UriBuilder();
     $uriBuilder->setRequest($request);
     $this->controllerContext = new ControllerContext($request, new Response(), new Arguments(array()), $uriBuilder);
     $view->setControllerContext($this->controllerContext);
     $view->disableFallbackView();
     $view->setPackageKey('Neos.Fusion');
     $view->setTypoScriptPathPattern(__DIR__ . '/Fixtures/TypoScript');
     $view->assign('fixtureDirectory', __DIR__ . '/Fixtures/');
     return $view;
 }
Example #3
0
 /**
  * Prepare a TypoScriptView for testing that Mocks a request with the given controller and action names.
  *
  * @param string $controllerObjectName
  * @param string $controllerActionName
  * @return FusionView
  */
 protected function buildView($controllerObjectName, $controllerActionName)
 {
     $request = $this->getMockBuilder(ActionRequest::class)->disableOriginalConstructor()->getMock();
     $request->expects($this->any())->method('getControllerObjectName')->will($this->returnValue($controllerObjectName));
     $request->expects($this->any())->method('getControllerActionName')->will($this->returnValue($controllerActionName));
     $this->mockControllerContext->expects($this->any())->method('getRequest')->will($this->returnValue($request));
     $view = new FusionView();
     $view->setControllerContext($this->mockControllerContext);
     $this->inject($view, 'fallbackView', $this->mockFallbackView);
     $view->setTypoScriptPathPattern(__DIR__ . '/Fixtures/Fusion');
     return $view;
 }