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 29992cd

Browse filesBrowse files
javiereguiluzweaverryan
authored andcommitted
[quick_tour] simplified the "routing" section
1 parent a84a556 commit 29992cd
Copy full SHA for 29992cd

File tree

Expand file treeCollapse file tree

2 files changed

+14
-19
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+14
-19
lines changed

‎images/quick_tour/hello_fabien.png

Copy file name to clipboard
33.7 KB
Loading

‎quick_tour/the_big_picture.rst

Copy file name to clipboardExpand all lines: quick_tour/the_big_picture.rst
+14-19Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ to run Symfony:
6262
6363
$ php app/console server:run
6464
65-
Open your browser and access to the ``http://localhost:8000/`` URL to see the
66-
Welcome page of Symfony2:
65+
Open your browser and access to the ``http://localhost:8000/app_dev.php`` URL to
66+
see the Welcome page of Symfony2:
6767

6868
.. image:: /images/quick_tour/symfony2_welcome_page.png
6969
:align: center
@@ -95,10 +95,10 @@ main concepts. Go to the following URL to be greeted by Symfony2 (replace
9595

9696
What's going on here? Have a look at each part of the URL:
9797

98-
* ``app_dev.php``: This is a :term:`front controller`. It is the unique entry
98+
* ``app_dev.php``: this is a :term:`front controller`. It is the unique entry
9999
point of the application and it responds to all user requests;
100100

101-
* ``/demo/hello/Fabien``: This is the *virtual path* to the resource the user
101+
* ``/demo/hello/Fabien``: this is the *virtual path* to the resource the user
102102
wants to access.
103103

104104
Your responsibility as a developer is to write the code that maps the user's
@@ -108,13 +108,9 @@ Your responsibility as a developer is to write the code that maps the user's
108108
Routing
109109
~~~~~~~
110110

111-
Symfony2 routes the request to the code that handles it by trying to match the
112-
requested URL (i.e. the virtual path) against some configured paths. By default,
113-
these paths (called routes) are defined in the ``app/config/routing.yml`` configuration
114-
file. When you're in the ``dev`` :ref:`environment<quick-tour-big-picture-environments>` -
115-
indicated by the app_**dev**.php front controller - the ``app/config/routing_dev.yml``
116-
configuration file is also loaded. In the Standard Edition, the routes to
117-
these "demo" pages are imported from this file:
111+
Symfony2 routes the request to the code that handles it by matching the
112+
requested URL (i.e. the virtual path) against some configured paths. The demo
113+
paths are defined in the ``app/config/routing_dev.yml`` configuration file:
118114

119115
.. code-block:: yaml
120116
@@ -125,13 +121,14 @@ these "demo" pages are imported from this file:
125121
_acme_demo:
126122
resource: "@AcmeDemoBundle/Resources/config/routing.yml"
127123
128-
This imports a ``routing.yml`` file that lives inside the AcmeDemoBundle:
124+
The ``_acme_demo`` routes are imported from a ``routing.yml`` file that lives
125+
inside the AcmeDemoBundle:
129126

130127
.. code-block:: yaml
131128
132129
# src/Acme/DemoBundle/Resources/config/routing.yml
133130
_welcome:
134-
path: /
131+
path: /
135132
defaults: { _controller: AcmeDemoBundle:Welcome:index }
136133
137134
_demo:
@@ -148,12 +145,10 @@ will be executed. In the next section, you'll learn exactly what that means.
148145

149146
.. tip::
150147

151-
The Symfony2 Standard Edition uses :doc:`YAML</components/yaml/yaml_format>`
152-
for its configuration files, but Symfony2 also supports XML, PHP, and
153-
annotations natively. The different formats are compatible and may be
154-
used interchangeably within an application. Also, the performance of
155-
your application does not depend on the configuration format you choose
156-
as everything is cached on the very first request.
148+
In addition to YAML format, routes can be configured in XML or PHP files
149+
and even as annotations on PHP classes. This flexibility is one of the main
150+
features of Symfony2, a framework that never imposes you a particular
151+
configuration format.
157152

158153
Controllers
159154
~~~~~~~~~~~

0 commit comments

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