Exemplo n.º 1
0
 /**
  * @param string $actionName
  * @return string
  */
 public function getTemplatePathAndFilename($actionName = NULL)
 {
     if (NULL !== $this->templatePathAndFilename) {
         return $this->templatePathAndFilename;
     }
     if (TRUE === empty($actionName)) {
         $actionName = $this->controllerContext->getRequest()->getControllerActionName();
     }
     $actionName = ResolveUtility::convertAllPathSegmentsToUpperCamelCase($actionName);
     $paths = $this->expandGenericPathPattern($this->templatePathAndFilenamePattern, FALSE, FALSE);
     foreach ($paths as &$templatePathAndFilename) {
         $templatePathAndFilename = str_replace('@action', $actionName, $templatePathAndFilename);
         if (TRUE === file_exists($templatePathAndFilename)) {
             return $templatePathAndFilename;
         }
     }
     return parent::getTemplatePathAndFilename($actionName);
 }
Exemplo n.º 2
0
 /**
  * Public-access wrapper for parent's method.
  *
  * @param string $actionName
  * @return string
  */
 public function getTemplatePathAndFilename($actionName = NULL)
 {
     return parent::getTemplatePathAndFilename($actionName);
 }
Exemplo n.º 3
0
 /**
  * Resolve the template path and filename for the given action. If $actionName
  * is NULL, looks into the current request.
  * 
  * Tries to read template path and filename from current settings.
  * Path can be set there by $controller->setTemplatePathAndFilename(Path to template)
  *
  * @param string $actionName Name of the action. If NULL, will be taken from request.
  * @return string Full path to template
  * @throws TYPO3\CMS\Fluid\View\Exception\InvalidTemplateResourceException
  */
 protected function getTemplatePathAndFilename($actionName = null)
 {
     if ($this->templatePathAndFilename != '') {
         if (file_exists($this->templatePathAndFilename)) {
             return $this->templatePathAndFilename;
         }
         if (file_exists(GeneralUtility::getFileAbsFileName($this->templatePathAndFilename))) {
             return GeneralUtility::getFileAbsFileName($this->templatePathAndFilename);
         }
     } else {
         if (method_exists('\\TYPO3\\CMS\\Fluid\\View\\TemplateView', 'getTemplatePathAndFilename')) {
             return parent::getTemplatePathAndFilename($actionName);
             // this method only exists in 1.4.0
         } else {
             return $actionName;
         }
     }
 }