Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d49e17f

Browse files
committed
Merge branch 'master' of https://github.com/n8v/symfony-docs into n8v-master
2 parents 92f54a7 + 2bbf442 commit d49e17f

File tree

4 files changed

+36
-34
lines changed

4 files changed

+36
-34
lines changed

quick_tour/the_architecture.rst

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@ The Architecture
22
================
33

44
You are my hero! Who would have thought that you would still be here after the
5-
first three parts? Your efforts will be well-rewarded soon. The first three
6-
parts didn't look too deeply at the architecture of the framework. As it makes
7-
Symfony2 stand apart from the framework crowd, let's dive into it now.
5+
first three parts? Your efforts will be well rewarded soon. The first three
6+
parts didn't look too deeply at the architecture of the framework. Because it
7+
makes Symfony2 stand apart from the framework crowd, let's dive in to the
8+
architecture now.
89

910
Understanding the Directory Structure
1011
-------------------------------------
@@ -237,11 +238,11 @@ specific configuration file:
237238
Extending a Bundle
238239
~~~~~~~~~~~~~~~~~~
239240

240-
In addition to be a nice way to organize and configure your code, a bundle can
241-
extend another one (bundles support inheritance). It allows you to override
242-
any existing bundle to customize its controllers, templates, and any file it
243-
contains. This is where the logical names come in handy as they abstract where
244-
the resource is actually stored.
241+
In addition to being a nice way to organize and configure your code, a bundle
242+
can extend another one. Bundle inheritance allows you to override any existing
243+
bundle to customize its controllers, templates, and any of its files. This is
244+
where the logical names come in handy, because they abstract where the resource
245+
is actually stored.
245246

246247
For controllers, Symfony2 will automatically choose the right file according
247248
to the bundle inheritance tree.
@@ -257,10 +258,11 @@ For controllers, you need to reference method names:
257258
``AcmeDemoBundle:Welcome:index`` means the ``indexAction`` method from the
258259
``Acme\DemoBundle\Controller\WelcomeController`` class.
259260

260-
For templates, it is even more interesting as templates do not need to be
261+
For templates, the logical name ``AcmeDemoBundle:Welcome:index.html.twig`` is
262+
converted to the file path ``src/Acme/DemoBundle/Resources/views/Welcome/index.html.twig``.
263+
Templates become even more interesting when you realize they don't need to be
261264
stored on the filesystem. You can easily store them in a database table for
262-
instance. For instance, ``AcmeDemoBundle:Welcome:index.html.twig`` is
263-
converted to ``src/Acme/DemoBundle/Resources/views/Welcome/index.html.twig``.
265+
instance.
264266

265267
Do you understand now why Symfony2 is so flexible? Share your bundles between
266268
applications, store them locally or globally, your choice.
@@ -276,9 +278,9 @@ templating system, and some other third party libraries and bundles.
276278
Understanding the Cache and Logs
277279
--------------------------------
278280

279-
Symfony2 is probably one of the fastest full-stack frameworks around. But how
281+
Symfony2 is probably one of the fastest full-stack frameworks around. How
280282
can it be so fast if it parses and interprets tens of YAML and XML files for
281-
each request? This is partly due to its cache system. The application
283+
each request? The speed is partly due to its cache system. The application
282284
configuration is only parsed for the very first request and then compiled down
283285
to plain PHP code stored in the ``app/cache/`` directory. In the development
284286
environment, Symfony2 is smart enough to flush the cache when you change a
@@ -312,9 +314,9 @@ Final Thoughts
312314
--------------
313315

314316
Call me crazy, but after reading this part, you should be comfortable with
315-
moving things around and making Symfony2 work for you. Everything is done in
316-
Symfony2 to get out of your way. So, feel free to rename and move directories
317-
around as you see fit.
317+
moving things around and making Symfony2 work for you. Everything in
318+
Symfony2 is designed to get out of your way. So, feel free to rename and
319+
move directories around as you see fit.
318320

319321
And that's all for the quick tour. From testing to sending emails, you still
320322
need to learn a lot to become a Symfony2 master. Ready to dig into these

quick_tour/the_big_picture.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,8 +256,8 @@ retrieved through the ``$name`` method argument.
256256

257257
If you have a closer look at the action code, you can see that instead of
258258
rendering a template like before, it just returns an array of parameters. The
259-
``@extra:Template()`` annotation takes care of rendering a template which name
260-
is determined based on some simple conventions (it will render
259+
``@extra:Template()`` annotation takes care of rendering a template the name
260+
of which is determined based on some simple conventions (it will render
261261
``src/Acme/DemoBundle/Resources/views/Demo/hello.html.twig``).
262262

263263
.. tip::

quick_tour/the_controller.rst

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ templates. It takes the route name and an array of parameters as arguments and
6969
returns the associated friendly URL.
7070

7171
You can also easily forward the action to another one with the ``forward()``
72-
method. As for the ``actions`` helper, it makes an internal sub-request, but
73-
it returns the ``Response`` object to allow for further modification::
72+
method. It makes an internal sub-request, but it returns the ``Response``
73+
object to allow for further modification::
7474

7575
$response = $this->forward('AcmeDemoBundle:Hello:fancy', array('name' => $name, 'color' => 'green'));
7676

@@ -176,15 +176,15 @@ Moreover, the ``admin`` user has a ``ROLE_ADMIN`` role, which includes the
176176

177177
.. tip::
178178

179-
For readability, passwords are stored in clear in this simple
180-
configuration, but using any hashing algorithm is a matter of tweaking the
179+
For readability, passwords are stored in clear text in this simple
180+
configuration, but you can use any hashing algorithm by tweaking the
181181
``encoders`` section.
182182

183183
Going to the ``http://localhost/Symfony/web/app_dev.php/demo/secured/hello``
184-
URL will automatically redirect you to the login form as this resource is
185-
protected by a firewall via a login form.
184+
URL will automatically redirect you to the login form because this resource is
185+
protected by a ``firewall``.
186186

187-
You can also force a given role to be required by using the ``@extra:Secure``
187+
You can also force the action to require a given role by using the ``@extra:Secure``
188188
annotation on the controller::
189189

190190
/**
@@ -198,12 +198,12 @@ annotation on the controller::
198198
}
199199

200200
Log in as ``user`` and from the secured hello page, click on the "Hello
201-
resource secured" link; Symfony2 should return a 403 HTTP status code.
201+
resource secured" link. Symfony2 should return a 403 HTTP status code.
202202

203203
.. note::
204204

205205
The Symfony2 security layer is very flexible and comes with many different
206-
user provides (like one for the Doctrine ORM) and authentication providers
206+
user providers (like one for the Doctrine ORM) and authentication providers
207207
(like HTTP basic, HTTP digest, or X509 certificates). Read the
208208
"`Security`_" chapter of the book for more information on how to use and
209209
configure them.
@@ -230,23 +230,23 @@ In this example, the resource will be cached for a day. But you can also use
230230
validation instead of expiration or a combination of both if that fits your
231231
needs better.
232232

233-
Resource caching is managed by the Symfony2 built-in reverse. But as caching
234-
is only managed by regular HTTP cache headers, you can also replace it with
235-
Varnish or Squid and easily scale your application.
233+
Resource caching is managed by the Symfony2 built-in reverse proxy. But because
234+
caching is only managed by regular HTTP cache headers, you can replace the
235+
built-in reverse proxy with Varnish or Squid and easily scale your application.
236236

237237
.. note::
238238

239239
But what if you cannot cache whole pages? Symfony2 still has the solution
240-
via Edge Side Includes (ESI) that are supported natively. Learn more by
240+
via Edge Side Includes (ESI) which are supported natively. Learn more by
241241
reading the "`HTTP Cache`_" chapter of the book.
242242

243243
Final Thoughts
244244
--------------
245245

246246
That's all there is to it, and I'm not even sure we have spent the allocated
247247
10 minutes. We briefly introduced bundles in the first part; and all the
248-
features we've learned about until now are part of the core framework bundle.
249-
But thanks to bundles, everything can be extended or replaced in Symfony2.
248+
features we've learned about so far are part of the core framework bundle.
249+
But thanks to bundles, everything in Symfony2 can be extended or replaced.
250250
That's the topic of the next part of this tutorial.
251251

252252
.. _Security: http://symfony.com/doc/2.0/book/security/index.html

quick_tour/the_view.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ Symfony2 provides the ``asset`` function to deal with them easily:
259259
260260
<img src="{{ asset('images/logo.png') }}" />
261261
262-
The ``asset`` function main purpose is to make your application more portable.
262+
The ``asset`` function's main purpose is to make your application more portable.
263263
Thanks to this function, you can move the application root directory anywhere
264264
under your web root directory without changing anything in your template's
265265
code.

0 commit comments

Comments
 (0)