コード例 #1
0
 /**
  * Resolve the path and file name of the layout file, based on
  * $this->layoutPathAndFilename and $this->layoutPathAndFilenamePattern.
  *
  * In case a layout has already been set with setLayoutPathAndFilename(),
  * this method returns that path, otherwise a path and filename will be
  * resolved using the layoutPathAndFilenamePattern.
  *
  * @param string $layoutName Name of the layout to use. If none given, use "Default"
  * @return string contents of the layout template
  * @throws \TYPO3\Fluid\View\Exception\InvalidTemplateResourceException
  */
 protected function getLayoutSource($layoutName = 'Default')
 {
     $layoutPathAndFilename = $this->getLayoutPathAndFilename($layoutName);
     $layoutSource = \TYPO3\FLuid\Utility\Files::getFileContents($layoutPathAndFilename, FILE_TEXT);
     if ($layoutSource === FALSE) {
         throw new \TYPO3\Fluid\View\Exception\InvalidTemplateResourceException('"' . $layoutPathAndFilename . '" is not a valid template resource URI.', 1257246929);
     }
     return $layoutSource;
 }
コード例 #2
0
 /**
  * Resolve the template path and filename for the given action. If $actionName
  * is NULL, looks into the current request.
  *
  * @param string $actionName Name of the action. If NULL, will be taken from request.
  * @return string Full path to template
  * @throws \TYPO3\Fluid\View\Exception\InvalidTemplateResourceException
  */
 protected function getTemplateSource($actionName = NULL)
 {
     $templatePathAndFilename = $this->getTemplatePathAndFilename($actionName);
     $templateSource = \TYPO3\Fluid\Utility\Files::getFileContents($templatePathAndFilename, FILE_TEXT);
     if ($templateSource === FALSE) {
         throw new \TYPO3\Fluid\View\Exception\InvalidTemplateResourceException('"' . $templatePathAndFilename . '" is not a valid template resource URI.', 1257246929);
     }
     return $templateSource;
 }