From fca1a5b75cd59d18630bcc1689da4063de43925c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Mon, 10 Sep 2018 22:43:33 +0200 Subject: [PATCH] [FrameworkBundle] Improve the DX of TemplateController --- templating/render_without_controller.rst | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/templating/render_without_controller.rst b/templating/render_without_controller.rst index 8cf110ed66b..8fc72527317 100644 --- a/templating/render_without_controller.rst +++ b/templating/render_without_controller.rst @@ -8,7 +8,7 @@ Usually, when you need to create a page, you need to create a controller and render a template from within that controller. But if you're rendering a simple template that doesn't need any data passed into it, you can avoid creating the controller entirely, by using the built-in -``Symfony\Bundle\FrameworkBundle\Controller\TemplateController::templateAction`` +:class:`Symfony\\Bundle\\FrameworkBundle\\Controller\\TemplateController` controller. For example, suppose you want to render a ``static/privacy.html.twig`` @@ -22,7 +22,7 @@ can do this without creating a controller: # config/routes.yaml acme_privacy: path: /privacy - controller: Symfony\Bundle\FrameworkBundle\Controller\TemplateController::templateAction + controller: Symfony\Bundle\FrameworkBundle\Controller\TemplateController defaults: template: static/privacy.html.twig @@ -35,7 +35,7 @@ can do this without creating a controller: xsi:schemaLocation="http://symfony.com/schema/routing http://symfony.com/schema/routing/routing-1.0.xsd"> - Symfony\Bundle\FrameworkBundle\Controller\TemplateController::templateAction + Symfony\Bundle\FrameworkBundle\Controller\TemplateController static/privacy.html.twig @@ -48,7 +48,7 @@ can do this without creating a controller: $routes = new RouteCollection(); $routes->add('acme_privacy', new Route('/privacy', array( - '_controller' => 'Symfony\Bundle\FrameworkBundle\Controller\TemplateController::templateAction', + '_controller' => 'Symfony\Bundle\FrameworkBundle\Controller\TemplateController', 'template' => 'static/privacy.html.twig', ))); @@ -83,7 +83,7 @@ other variables in your route, you can control exactly how your page is cached: # config/routes.yaml acme_privacy: path: /privacy - controller: Symfony\Bundle\FrameworkBundle\Controller\TemplateController::templateAction + controller: Symfony\Bundle\FrameworkBundle\Controller\TemplateController defaults: template: 'static/privacy.html.twig' maxAge: 86400 @@ -98,7 +98,7 @@ other variables in your route, you can control exactly how your page is cached: xsi:schemaLocation="http://symfony.com/schema/routing http://symfony.com/schema/routing/routing-1.0.xsd"> - Symfony\Bundle\FrameworkBundle\Controller\TemplateController::templateAction + Symfony\Bundle\FrameworkBundle\Controller\TemplateController static/privacy.html.twig 86400 86400 @@ -113,7 +113,7 @@ other variables in your route, you can control exactly how your page is cached: $routes = new RouteCollection(); $routes->add('acme_privacy', new Route('/privacy', array( - '_controller' => 'Symfony\Bundle\FrameworkBundle\Controller\TemplateController::templateAction', + '_controller' => 'Symfony\Bundle\FrameworkBundle\Controller\TemplateController', 'template' => 'static/privacy.html.twig', 'maxAge' => 86400, 'sharedAge' => 86400, pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy