1
1
The Big Picture
2
2
===============
3
3
4
- Start using Symfony2 in 10 minutes! This tutorial contains some important
5
- concepts behind Symfony2. It explains how to get started quickly by showing you
6
- the structure of a sample project.
4
+ Start using Symfony2 in 10 minutes! This tutorial walks you through some
5
+ of the most important concepts behind Symfony2. It explains how to get started
6
+ quickly by showing you the structure of a sample project.
7
7
8
- If you have used a web framework before, you should feel right at home
9
- with Symfony2.
8
+ If you've used a web framework before, you should feel right at home with
9
+ Symfony2. If not, welcome to a whole new way of developing web applications!
10
10
11
11
.. index ::
12
12
pair: Sandbox; Download
@@ -50,8 +50,8 @@ Checking the Configuration
50
50
--------------------------
51
51
52
52
Symfony2 comes with a visual server configuration tester to help avoid some
53
- headaches that come from web server or php misconfiguration. Please use
54
- the following url to see the diagnostics for your server:
53
+ headaches that come from web server or PHP misconfiguration. Use the following
54
+ url to see the diagnostics for your server:
55
55
56
56
http://localhost/sandbox/web/check.php
57
57
@@ -75,9 +75,9 @@ Symfony2 should congratulate you for your hard work so far!
75
75
Creating your first Application
76
76
-------------------------------
77
77
78
- The sandbox comes with a simple Hello World ":term: `application `" we will use
79
- to learn more about Symfony2. Go to the following URL to be greeted by Symfony2
80
- (replace Fabien with your first name):
78
+ The sandbox comes with a simple Hello World ":term: `application `" that we'll
79
+ use to learn more about Symfony2. Go to the following URL to be greeted by
80
+ Symfony2 (replace Fabien with your first name):
81
81
82
82
http://localhost/sandbox/web/app_dev.php/hello/Fabien
83
83
@@ -108,7 +108,8 @@ application.
108
108
.. tip ::
109
109
110
110
The sandbox defaults to YAML, but you can easily switch to XML or PHP by
111
- editing the ``app/AppKernel.php `` file.
111
+ opening the ``app/AppKernel.php `` file and modifying the
112
+ ``registerContainerConfiguration `` method.
112
113
113
114
.. index ::
114
115
single: Routing
@@ -117,7 +118,7 @@ application.
117
118
Routing
118
119
~~~~~~~
119
120
120
- Symfony2 routes the request to your code by using a configuration file. Here
121
+ Symfony2 routes the request to your code by using a configuration file. Here
121
122
are a few examples of the routing configuration file for our application:
122
123
123
124
.. configuration-block ::
@@ -163,13 +164,14 @@ are a few examples of the routing configuration file for our application:
163
164
return $collection;
164
165
165
166
The first few lines of the routing configuration file define the code that is
166
- executed when the user requests the "``/ ``" resource.
167
+ executed when the user requests the "``/ ``" resource (i.e. the homepage) .
167
168
168
- .. tip ::
169
-
170
- If you're comfortable with routing, have a look at the last directive of
171
- the configuration file. Symfony2 can include routing information from
172
- other bundles.
169
+ If you're comfortable with routing, take a look at the last directive of
170
+ the configuration file. Symfony2 can include routing information from
171
+ other routing configuration files by using the ``import `` directive. In this
172
+ case, we want to import the routing configuration from ``HelloBundle ``. A
173
+ bundle is like a plugin that has added power and we'll talk more about them
174
+ later. For now, let's look at the routing configuration that we've imported:
173
175
174
176
.. configuration-block ::
175
177
@@ -207,9 +209,9 @@ executed when the user requests the "``/``" resource.
207
209
208
210
return $collection;
209
211
210
- As you can see, the "``/hello/{name} ``" resource pattern (a string
211
- enclosed in curly brackets like ``{name} `` is a placeholder) is mapped to a
212
- controller, referenced by the ``_controller `` value.
212
+ As you can see, the "``/hello/{name} ``" resource pattern (a string enclosed
213
+ in curly brackets like ``{name} `` is a placeholder) is mapped to a controller,
214
+ referenced by the ``_controller `` value.
213
215
214
216
.. index ::
215
217
single: Controller
@@ -313,17 +315,18 @@ And if you use Apache with ``mod_rewrite`` enabled, you can even omit the
313
315
314
316
To make the production environment as fast as possible, Symfony2 maintains a
315
317
cache under the ``app/cache/ `` directory. When you make changes to the code or
316
- configuration, you need to manually remove the cached files. The development
317
- front controller (``app_dev.php ``) does not use this cache and your changes
318
- appear immediately, thus is recommended when working on a project.
318
+ configuration, you need to manually remove the cached files. When developing
319
+ your application, you should use the development front controller (``app_dev.php ``),
320
+ which does not use the cache. When using the development front controller,
321
+ your changes will appear immediately.
319
322
320
323
Final Thoughts
321
324
--------------
322
325
323
326
Thanks for trying out Symfony2! By now, you should be able to create your own
324
327
simple routes, controllers and templates. As an exercise, try to build
325
328
something more useful than the Hello application! If you are eager to
326
- learn more about Symfony2, dive into the next section: the view system .
329
+ learn more about Symfony2, dive into the next section: "The View" .
327
330
328
331
.. _sandbox : http://symfony-reloaded.org/code#sandbox
329
332
.. _YAML : http://www.yaml.org/
0 commit comments