/** * Returns a full path for a given file. * * @param TemplateReferenceInterface $template A template * @param string $currentPath Unused * @param bool $first Unused * * @return string The full path for the file * * @throws \InvalidArgumentException When the template is not an instance of TemplateReferenceInterface * @throws \InvalidArgumentException When the template file can not be found */ public function locate($template, $currentPath = null, $first = true) { if (!$template instanceof TemplateReferenceInterface) { throw new \InvalidArgumentException("The template must be an instance of TemplateReferenceInterface."); } $themes = $this->themeContext->getThemes(); $templatePath = $this->locateTemplateUsingThemes($template, $themes); if (null === $templatePath) { throw new \InvalidArgumentException(sprintf('Unable to find template "%s" (using themes: %s).', $template, join(', ', $themes))); } return $templatePath; }
/** * {@inheritdoc} */ public function collect(Request $request, Response $response, \Exception $exception = null) { $this->usedThemes = $this->themeContext->getThemes(); $this->allThemes = $this->themeRepository->findAll(); }
/** * {@inheritdoc} */ public function transChoice($id, $number, array $parameters = [], $domain = null, $locale = null) { return $this->doTranslate($id, $parameters, $domain, $locale, $number, $this->themeContext->getThemes()); }