Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
core/src/Controller/Frontend/TemplateController.php /
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
27 lines (22 sloc)
855 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| declare(strict_types=1); | |
| namespace Bolt\Controller\Frontend; | |
| use Bolt\Controller\TwigAwareController; | |
| use Symfony\Component\HttpFoundation\Response; | |
| use Symfony\Component\Routing\Annotation\Route; | |
| class TemplateController extends TwigAwareController implements FrontendZoneInterface | |
| { | |
| /** | |
| * Render a template. Convenient for when we simply wish to render a template as-is. Used as a | |
| * fallback for the 404 or maintenance pages, for instance. | |
| * | |
| * Note: This is _not_ assigned a Route by default. If it were, it's a potential security risk, | |
| * since a would-be attacker could try to access template files from both the theme and bolt | |
| * directly. | |
| */ | |
| public function template(string $templateName): Response | |
| { | |
| $templates = [$templateName]; | |
| return $this->render($templates, []); | |
| } | |
| } |