setPartialRootPath() public méthode

Sets the absolute path to the folder that contains Fluid partial files.
public setPartialRootPath ( string $partialRootPath ) : void
$partialRootPath string Fluid partial root path
Résultat void
 /**
  * @test
  * @expectedException \Neos\FluidAdaptor\View\Exception\InvalidTemplateResourceException
  */
 public function getPartialPathAndFilenameThrowsExceptionIfPartialFileIsADirectory()
 {
     vfsStreamWrapper::register();
     mkdir('vfs://MyPartials/NotAFile');
     $this->standaloneView->setPartialRootPath('vfs://MyPartials');
     $this->standaloneView->getTemplatePaths()->getPartialSource('NotAFile');
 }
 /**
  * Prepare a Fluid view for rendering an error page with the Neos backend
  *
  * @return StandaloneView
  */
 protected function prepareFluidView()
 {
     $fluidView = new StandaloneView();
     $fluidView->setControllerContext($this->runtime->getControllerContext());
     $fluidView->setFormat('html');
     $fluidView->setTemplatePathAndFilename('resource://Neos.Neos/Private/Templates/Error/NeosBackendMessage.html');
     $fluidView->setLayoutRootPath('resource://Neos.Neos/Private/Layouts/');
     // FIXME find a better way than using templates as partials
     $fluidView->setPartialRootPath('resource://Neos.Neos/Private/Templates/TypoScriptObjects/');
     return $fluidView;
 }
 /**
  * @param NodeInterface $node
  * @return string
  * @throws NeosException
  */
 public function render(NodeInterface $node)
 {
     if ($this->privilegeManager->isPrivilegeTargetGranted('Neos.Neos:Backend.GeneralAccess') === false) {
         return '';
     }
     /** @var $actionRequest ActionRequest */
     $actionRequest = $this->controllerContext->getRequest();
     $innerView = new StandaloneView($actionRequest);
     $innerView->setTemplatePathAndFilename('resource://Neos.Neos/Private/Templates/Backend/Content/Container.html');
     $innerView->setFormat('html');
     $innerView->setPartialRootPath('resource://Neos.Neos/Private/Partials');
     $user = $this->partyService->getAssignedPartyOfAccount($this->securityContext->getAccount());
     $innerView->assignMultiple(array('node' => $node, 'modules' => $this->menuHelper->buildModuleList($this->controllerContext), 'sites' => $this->menuHelper->buildSiteList($this->controllerContext), 'user' => $user));
     return $innerView->render();
 }
Exemple #4
0
 /**
  * @return StandaloneView
  * @throws FinisherException
  */
 protected function initializeStandaloneView()
 {
     $standaloneView = new StandaloneView();
     if (!isset($this->options['templatePathAndFilename'])) {
         throw new FinisherException('The option "templatePathAndFilename" must be set for the EmailFinisher.', 1327058829);
     }
     $standaloneView->setTemplatePathAndFilename($this->options['templatePathAndFilename']);
     if (isset($this->options['partialRootPath'])) {
         $standaloneView->setPartialRootPath($this->options['partialRootPath']);
     }
     if (isset($this->options['layoutRootPath'])) {
         $standaloneView->setLayoutRootPath($this->options['layoutRootPath']);
     }
     if (isset($this->options['variables'])) {
         $standaloneView->assignMultiple($this->options['variables']);
     }
     return $standaloneView;
 }