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

Appearance settings

Commit f0a1342

Browse filesBrowse files
committed
Merge branch '2.0'
2 parents cf7da60 + 01d2749 commit f0a1342
Copy full SHA for f0a1342

File tree

Expand file treeCollapse file tree

6 files changed

+45
-5
lines changed
Filter options
Expand file treeCollapse file tree

6 files changed

+45
-5
lines changed

‎book/forms.rst

Copy file name to clipboardExpand all lines: book/forms.rst
+1-3Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -321,9 +321,7 @@ object.
321321
</property>
322322
<property name="dueDate">
323323
<constraint name="NotBlank" />
324-
<constraint name="Type">
325-
<value>\DateTime</value>
326-
</constraint>
324+
<constraint name="Type">\DateTime</constraint>
327325
</property>
328326
</class>
329327

‎contributing/documentation/overview.rst

Copy file name to clipboardExpand all lines: contributing/documentation/overview.rst
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ then clone your fork:
2525
2626
$ git clone git://github.com/YOURUSERNAME/symfony-docs.git
2727
28-
Unless you're documenting a feature that's new to Symfony 2.1, you changes
28+
Unless you're documenting a feature that's new to Symfony 2.1, your changes
2929
should be based on the 2.0 branch instead of the master branch. To do this
3030
checkout the 2.0 branch before the next step:
3131

‎cookbook/form/form_customization.rst

Copy file name to clipboardExpand all lines: cookbook/form/form_customization.rst
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ When rendering a form, you can choose which form theme(s) you want to apply.
175175
In Twig a theme is a single template file and the fragments are the blocks defined
176176
in this file.
177177

178-
In PHP a theme is a folder and the the fragments are individual template files in
178+
In PHP a theme is a folder and the fragments are individual template files in
179179
this folder.
180180

181181
.. _cookbook-form-customization-sidebar:

‎cookbook/map.rst.inc

Copy file name to clipboardExpand all lines: cookbook/map.rst.inc
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@
8686

8787
* :doc:`/cookbook/routing/scheme`
8888
* :doc:`/cookbook/routing/slash_in_parameter`
89+
* :doc:`/cookbook/routing/redirect_in_config`
8990

9091
* **symfony1**
9192

‎cookbook/routing/index.rst

Copy file name to clipboardExpand all lines: cookbook/routing/index.rst
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ Routing
66

77
scheme
88
slash_in_parameter
9+
redirect_in_config
+40Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
.. index::
2+
single: Routing; Configure redirect to another route without a custom controller
3+
4+
How to configure a redirect to another route without a custom controller
5+
========================================================================
6+
7+
This guide explains how to configure a redirect from one route to another
8+
without using a custom controller.
9+
10+
Let's assume that there is no useful default controller for the ``/`` path of
11+
your application and you want to redirect theses requests to ``/app``.
12+
13+
Your configuration will look like this:
14+
15+
.. code-block:: yaml
16+
17+
AppBundle:
18+
resource: "@App/Controller/"
19+
type: annotation
20+
prefix: /app
21+
22+
root:
23+
pattern: /
24+
defaults:
25+
_controller: FrameworkBundle:Redirect:urlRedirect
26+
path: /app
27+
permanent: true
28+
29+
Your ``AppBundle`` is registered to handle all requests under ``/app``.
30+
31+
We configure a route for the ``/`` path and let :class:`Symfony\\Bundle\\FrameworkBundle\\Controller\\RedirectController`
32+
handle it. This controller is built-in and offers two methods for redirecting request:
33+
34+
* ``redirect`` redirects to another *route*. You must provide the ``route``
35+
parameter with the *name* of the route you want to redirect to.
36+
37+
* ``urlRedirect`` redirects to another *path*. You must provide the ``path``
38+
parameter containing the path of the resource you want to redirect to.
39+
40+
The ``permanent`` switch tells both methods to issue a 301 HTTP status code.

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.