Neos\FluidAdaptor\View\TemplatePaths::resolveTemplateFileForControllerAndActionAndFormat PHP Method

resolveTemplateFileForControllerAndActionAndFormat() public method

Resolves a template file based on the given controller and action, together with eventually defined patternReplacementVariables.
public resolveTemplateFileForControllerAndActionAndFormat ( string $controller, string $action, string $format = null ) : mixed | string
$controller string
$action string
$format string
return mixed | string
    public function resolveTemplateFileForControllerAndActionAndFormat($controller, $action, $format = null)
    {
        if ($this->templatePathAndFilename) {
            return $this->templatePathAndFilename;
        }
        $action = ucfirst($action);
        $paths = $this->getTemplateRootPaths();
        if (isset($this->options['templatePathAndFilenamePattern'])) {
            $paths = $this->expandGenericPathPattern($this->options['templatePathAndFilenamePattern'], array_merge($this->patternReplacementVariables, ['controllerName' => $controller, 'action' => $action, 'format' => $format !== null ? $format : $this->patternReplacementVariables['format']]), false, false);
        }
        foreach ($paths as $path) {
            if (is_file($path)) {
                return $path;
            }
        }
        throw new Exception\InvalidTemplateResourceException('Template could not be loaded. I tried "' . implode('", "', $paths) . '"', 1225709595);
    }