@@ -26,7 +26,7 @@ of database calls, HTML tags and other PHP code in the same script. To achieve
26
26
this goal with Symfony, you'll first need to learn a few fundamental concepts.
27
27
28
28
When developing a Symfony application, your responsibility as a developer
29
- is to write the code that maps the user's *request * (e.g. ``http://localhost:8000/app/example ``)
29
+ is to write the code that maps the user's *request * (e.g. ``http://localhost:8000/ ``)
30
30
to the *resource * associated with it (the ``Homepage `` HTML page).
31
31
32
32
The code to execute is defined in **actions ** and **controllers **. The mapping
@@ -54,7 +54,7 @@ because that will be explained in the next section)::
54
54
class DefaultController extends Controller
55
55
{
56
56
/**
57
- * @Route("/app/example ", name="homepage")
57
+ * @Route("/", name="homepage")
58
58
*/
59
59
public function indexAction()
60
60
{
@@ -96,7 +96,7 @@ at the three lines of code above the ``indexAction`` method::
96
96
class DefaultController extends Controller
97
97
{
98
98
/**
99
- * @Route("/app/example ", name="homepage")
99
+ * @Route("/", name="homepage")
100
100
*/
101
101
public function indexAction()
102
102
{
@@ -112,15 +112,14 @@ start with ``/**``, whereas regular PHP comments start with ``/*``.
112
112
The first value of ``@Route() `` defines the URL that will trigger the execution
113
113
of the action. As you don't have to add the host of your application to
114
114
the URL (e.g. ```http://example.com ``), these URLs are always relative and
115
- they are usually called *paths *. In this case, the ``/app/example `` path
116
- refers to the application homepage. The second value of ``@Route() `` (e.g.
117
- `` name="homepage" ``) is optional and sets the name of this route. For now
118
- this name is not needed, but later it'll be useful for linking pages.
115
+ they are usually called *paths *. In this case, the ``/ `` path refers to the
116
+ application homepage. The second value of ``@Route() `` (e.g. `` name="homepage" ``)
117
+ is optional and sets the name of this route. For now this name is not needed,
118
+ but later it'll be useful for linking pages.
119
119
120
- Considering all this, the ``@Route("/app/example", name="homepage") `` annotation
121
- creates a new route called ``homepage `` which makes Symfony execute the
122
- ``index `` action of the ``Default `` controller when the user browses the
123
- ``/app/example `` path of the application.
120
+ Considering all this, the ``@Route("/", name="homepage") `` annotation creates a
121
+ new route called ``homepage `` which makes Symfony execute the ``index `` action
122
+ of the ``Default `` controller when the user browses the ``/ `` path of the application.
124
123
125
124
.. tip ::
126
125
@@ -152,13 +151,14 @@ you'll see the following code:
152
151
{% extends 'base.html.twig' %}
153
152
154
153
{% block body %}
155
- Homepage.
154
+ <h1>Welcome to Symfony</h1>
155
+
156
+ {# ... #}
156
157
{% endblock %}
157
158
158
- This template is created with `Twig `_, a new template engine created for
159
- modern PHP applications. The
160
- :doc: `second part of this tutorial </quick_tour/the_view >` will introduce
161
- how templates work in Symfony.
159
+ This template is created with `Twig `_, a template engine created for modern PHP
160
+ applications. The :doc: `second part of this tutorial </quick_tour/the_view >`
161
+ explains how templates work in Symfony.
162
162
163
163
.. _quick-tour-big-picture-environments :
164
164
0 commit comments