@@ -18,11 +18,11 @@ Download and Install
18
18
First, check that you have at least PHP 5.3.2 installed and correctly
19
19
configured to work with a web server like Apache.
20
20
21
- Ready? Let's start by downloading Symfony . To get started even faster, we are
22
- going to use the "Symfony sandbox". It is a Symfony project where all the
21
+ Ready? Let's start by downloading Symfony2 . To get started even faster, we are
22
+ going to use the "Symfony2 sandbox". It is a Symfony2 project where all the
23
23
required libraries and some simple controllers are already included; the basic
24
24
configuration is also already done. The great advantage of the sandbox over
25
- other types of installation is that you can start experimenting with Symfony
25
+ other types of installation is that you can start experimenting with Symfony2
26
26
immediately.
27
27
28
28
Download the `sandbox `_, and unpack it in your root web directory. You
@@ -50,24 +50,24 @@ Check the Configuration
50
50
-----------------------
51
51
52
52
To avoid some headaches further down the line, check that your configuration
53
- can run a Symfony project smoothly by requesting the following URL:
53
+ can run a Symfony2 project smoothly by requesting the following URL:
54
54
55
55
http://localhost/sandbox/web/check.php
56
56
57
57
Read the script output carefully and fix any problem that it finds.
58
58
59
- Now, request your first "real" Symfony webpage:
59
+ Now, request your first "real" Symfony2 webpage:
60
60
61
61
http://localhost/sandbox/web/index_dev.php/
62
62
63
- Symfony should congratulate you for your hard work so far!
63
+ Symfony2 should congratulate you for your hard work so far!
64
64
65
65
Your first Application
66
66
----------------------
67
67
68
68
The sandbox comes with a simple Hello World ":term: `application `" and that's
69
- the application we will use to learn more about Symfony . Go to the following
70
- URL to be greeted by Symfony (replace Fabien with your first name):
69
+ the application we will use to learn more about Symfony2 . Go to the following
70
+ URL to be greeted by Symfony2 (replace Fabien with your first name):
71
71
72
72
http://localhost/sandbox/web/index_dev.php/hello/Fabien
73
73
@@ -91,7 +91,7 @@ Fabien!``).
91
91
Configuration
92
92
~~~~~~~~~~~~~
93
93
94
- But how does Symfony route the request to your code? Simply by reading some
94
+ But how does Symfony2 route the request to your code? Simply by reading some
95
95
configuration file.
96
96
97
97
All Symfony2 configuration files can be written in either PHP, XML, or `YAML `_
@@ -111,7 +111,7 @@ very easy).
111
111
Routing
112
112
~~~~~~~
113
113
114
- So, Symfony routes the request by reading the routing configuration file:
114
+ So, Symfony2 routes the request by reading the routing configuration file:
115
115
116
116
.. configuration-block ::
117
117
@@ -228,7 +228,7 @@ The controller is responsible for returning a representation of the resource
228
228
229
229
The code is pretty straightforward but let's explain this code line by line:
230
230
231
- * *line 3 *: Symfony takes advantage of new PHP 5.3 features and as such, all
231
+ * *line 3 *: Symfony2 takes advantage of new PHP 5.3 features and as such, all
232
232
controllers are properly namespaced (the namespace is the first part of the
233
233
``_controller `` routing value: ``HelloBundle ``).
234
234
@@ -246,8 +246,8 @@ The code is pretty straightforward but let's explain this code line by line:
246
246
(``HelloBundle:Hello:index ``) with the variables passed as a second
247
247
argument.
248
248
249
- But what is a :term: `bundle `? All the code you write in a Symfony project is
250
- organized in bundles. In Symfony speak, a bundle is a structured set of files
249
+ But what is a :term: `bundle `? All the code you write in a Symfony2 project is
250
+ organized in bundles. In Symfony2 speak, a bundle is a structured set of files
251
251
(PHP files, stylesheets, JavaScripts, images, ...) that implements a single
252
252
feature (a blog, a forum, ...) and which can be easily shared with other
253
253
developers. In our example, we only have one bundle, ``HelloBundle ``.
@@ -267,8 +267,8 @@ is made of HTML and simple PHP expressions:
267
267
268
268
Hello <?php echo $name ?>!
269
269
270
- Congratulations! You have looked at your first Symfony piece of code. That was
271
- not so hard, was it? Symfony makes it really easy to implement web sites
270
+ Congratulations! You have looked at your first Symfony2 piece of code. That was
271
+ not so hard, was it? Symfony2 makes it really easy to implement web sites
272
272
better and faster.
273
273
274
274
.. index ::
@@ -278,13 +278,13 @@ better and faster.
278
278
Environments
279
279
------------
280
280
281
- Now that you have a better understanding on how Symfony works, have a closer
282
- look at the bottom of the page; you will notice a small bar with the Symfony
281
+ Now that you have a better understanding on how Symfony2 works, have a closer
282
+ look at the bottom of the page; you will notice a small bar with the Symfony2
283
283
and PHP logos. It is called the "Web Debug Toolbar" and it is the developer's
284
284
best friend. Of course, such a tool must not be displayed when you deploy your
285
285
application to your production servers. That's why you will find another front
286
- controller in the ``web/ `` directory (``index.php ``), optimized for the production
287
- environment:
286
+ controller in the ``web/ `` directory (``index.php ``), optimized for the
287
+ production environment:
288
288
289
289
http://localhost/sandbox/web/index.php/hello/Fabien
290
290
@@ -299,7 +299,7 @@ better looking URL:
299
299
300
300
http://localhost/hello/Fabien
301
301
302
- To make the production environment as fast as possible, Symfony maintains a
302
+ To make the production environment as fast as possible, Symfony2 maintains a
303
303
cache under the ``app/cache/ `` directory. When you make changes, you need to
304
304
manually remove the cached files. That's why you should always use the
305
305
development front controller (``index_dev.php ``) when working on a project.
@@ -310,7 +310,7 @@ Final Thoughts
310
310
The 10 minutes are over. By now, you should be able to create your own simple
311
311
routes, controllers, and templates. As an exercise, try to build something
312
312
more useful than the Hello application! But if you are eager to learn more
313
- about Symfony , you can read the next part of this tutorial right away, where
313
+ about Symfony2 , you can read the next part of this tutorial right away, where
314
314
we dive more into the templating system.
315
315
316
316
.. _sandbox : http://symfony-reloaded.org/code#sandbox
0 commit comments