@@ -131,7 +131,7 @@ of database calls, HTML tags and other PHP code in the same script. To achieve
131
131
this goal with Symfony, you'll first need to learn a few fundamental concepts.
132
132
133
133
When developing a Symfony application, your responsibility as a developer
134
- is to write the code that maps the user's *request * (e.g. ``http://localhost:8000/app/example ``)
134
+ is to write the code that maps the user's *request * (e.g. ``http://localhost:8000/ ``)
135
135
to the *resource * associated with it (the ``Homepage `` HTML page).
136
136
137
137
The code to execute is defined in **actions ** and **controllers **. The mapping
@@ -159,7 +159,7 @@ because that will be explained in the next section)::
159
159
class DefaultController extends Controller
160
160
{
161
161
/**
162
- * @Route("/app/example ", name="homepage")
162
+ * @Route("/", name="homepage")
163
163
*/
164
164
public function indexAction()
165
165
{
@@ -201,7 +201,7 @@ at the three lines of code above the ``indexAction`` method::
201
201
class DefaultController extends Controller
202
202
{
203
203
/**
204
- * @Route("/app/example ", name="homepage")
204
+ * @Route("/", name="homepage")
205
205
*/
206
206
public function indexAction()
207
207
{
@@ -217,15 +217,14 @@ start with ``/**``, whereas regular PHP comments start with ``/*``.
217
217
The first value of ``@Route() `` defines the URL that will trigger the execution
218
218
of the action. As you don't have to add the host of your application to
219
219
the URL (e.g. ```http://example.com ``), these URLs are always relative and
220
- they are usually called *paths *. In this case, the ``/app/example `` path
221
- refers to the application homepage. The second value of ``@Route() `` (e.g.
222
- `` name="homepage" ``) is optional and sets the name of this route. For now
223
- this name is not needed, but later it'll be useful for linking pages.
220
+ they are usually called *paths *. In this case, the ``/ `` path refers to the
221
+ application homepage. The second value of ``@Route() `` (e.g. `` name="homepage" ``)
222
+ is optional and sets the name of this route. For now this name is not needed,
223
+ but later it'll be useful for linking pages.
224
224
225
- Considering all this, the ``@Route("/app/example", name="homepage") `` annotation
226
- creates a new route called ``homepage `` which makes Symfony execute the
227
- ``index `` action of the ``Default `` controller when the user browses the
228
- ``/app/example `` path of the application.
225
+ Considering all this, the ``@Route("/", name="homepage") `` annotation creates a
226
+ new route called ``homepage `` which makes Symfony execute the ``index `` action
227
+ of the ``Default `` controller when the user browses the ``/ `` path of the application.
229
228
230
229
.. tip ::
231
230
@@ -257,13 +256,14 @@ you'll see the following code:
257
256
{% extends 'base.html.twig' %}
258
257
259
258
{% block body %}
260
- Homepage.
259
+ <h1>Welcome to Symfony</h1>
260
+
261
+ {# ... #}
261
262
{% endblock %}
262
263
263
- This template is created with `Twig `_, a new template engine created for
264
- modern PHP applications. The
265
- :doc: `second part of this tutorial </quick_tour/the_view >` will introduce
266
- how templates work in Symfony.
264
+ This template is created with `Twig `_, a template engine created for modern PHP
265
+ applications. The :doc: `second part of this tutorial </quick_tour/the_view >`
266
+ explains how templates work in Symfony.
267
267
268
268
.. _quick-tour-big-picture-environments :
269
269
0 commit comments