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);
}