Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[FrameworkBundle] Improve the DX of TemplateController#10320

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
javiereguiluz merged 1 commit intosymfony:4.1fromdunglas:pr_24637
Sep 11, 2018
Merged
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletionstemplating/render_without_controller.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -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``
Expand All@@ -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

Expand All@@ -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">

<route id="acme_privacy" path="/privacy">
<default key="_controller">Symfony\Bundle\FrameworkBundle\Controller\TemplateController::templateAction</default>
<default key="_controller">Symfony\Bundle\FrameworkBundle\Controller\TemplateController</default>
<default key="template">static/privacy.html.twig</default>
</route>
</routes>
Expand All@@ -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',
)));

Expand DownExpand Up@@ -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
Expand All@@ -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">

<route id="acme_privacy" path="/privacy">
<default key="_controller">Symfony\Bundle\FrameworkBundle\Controller\TemplateController::templateAction</default>
<default key="_controller">Symfony\Bundle\FrameworkBundle\Controller\TemplateController</default>
<default key="template">static/privacy.html.twig</default>
<default key="maxAge">86400</default>
<default key="sharedAge">86400</default>
Expand All@@ -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,
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp