Skip to content

Commit 6058408

Browse files
committed
Merge branch '2.4'
2 parents 8bd668e + a45fee8 commit 6058408

File tree

73 files changed

+441
-233
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+441
-233
lines changed

book/forms.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ Submitting Forms with Multiple Buttons
281281

282282
When your form contains more than one submit button, you will want to check
283283
which of the buttons was clicked to adapt the program flow in your controller.
284-
Let's add a second button with the caption "Save and add" to our form::
284+
To do this, add a second button with the caption "Save and add" to your form::
285285

286286
$form = $this->createFormBuilder($task)
287287
->add('task', 'text')
@@ -552,8 +552,8 @@ Groups based on the Clicked Button
552552
When your form contains multiple submit buttons, you can change the validation
553553
group depending on which button is used to submit the form. For example,
554554
consider a form in a wizard that lets you advance to the next step or go back
555-
to the previous step. Let's assume also that when returning to the previous
556-
step, the data of the form should be saved, but not validated.
555+
to the previous step. Also assume that when returning to the previous step,
556+
the data of the form should be saved, but not validated.
557557

558558
First, we need to add the two buttons to the form::
559559

book/from_flat_php_to_symfony2.rst

+2-4
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,6 @@ to maintain. There are several problems that need to be addressed:
7575
tied to MySQL. Though not covered here, Symfony2 fully integrates `Doctrine`_,
7676
a library dedicated to database abstraction and mapping.
7777

78-
Let's get to work on solving these problems and more.
79-
8078
Isolating the Presentation
8179
~~~~~~~~~~~~~~~~~~~~~~~~~~
8280

@@ -676,8 +674,8 @@ Where Symfony2 Delivers
676674
~~~~~~~~~~~~~~~~~~~~~~~
677675

678676
In the upcoming chapters, you'll learn more about how each piece of Symfony
679-
works and the recommended organization of a project. For now, let's see how
680-
migrating the blog from flat PHP to Symfony2 has improved life:
677+
works and the recommended organization of a project. For now, have a look
678+
at how migrating the blog from flat PHP to Symfony2 has improved life:
681679

682680
* Your application now has **clear and consistently organized code** (though
683681
Symfony doesn't force you into this). This promotes **reusability** and

book/propel.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ configuration file (``config.yml``):
5555
5656
propel:
5757
dbal:
58-
driver: "%database_driver%"
59-
user: "%database_user%"
60-
password: "%database_password%"
61-
dsn: "%database_driver%:host=%database_host%;dbname=%database_name%;charset=%database_charset%"
58+
driver: "%database_driver%"
59+
user: "%database_user%"
60+
password: "%database_password%"
61+
dsn: "%database_driver%:host=%database_host%;dbname=%database_name%;charset=%database_charset%"
6262
6363
Now that Propel knows about your database, Symfony2 can create the database for
6464
you:

book/routing.rst

+7
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,13 @@ match, giving the ``page`` parameter a value of ``2``. Perfect.
428428
| /blog/2 | blog | {page} = 2 |
429429
+--------------------+-------+-----------------------+
430430

431+
.. caution::
432+
433+
Of course, you can have more than one optional placeholder (e.g. ``/blog/{slug}/{page}``),
434+
but everything after an optional placeholder must be optional. For example,
435+
``/{page}/blog`` is a valid path, but ``page`` will always be required
436+
(i.e. simply ``/blog`` will not match this route).
437+
431438
.. tip::
432439

433440
Routes with optional parameters at the end will not match on requests

book/security.rst

+14-15
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ authentication (i.e. the old-school username/password box):
4545
security:
4646
firewalls:
4747
secured_area:
48-
pattern: ^/
48+
pattern: ^/
4949
anonymous: ~
5050
http_basic:
5151
realm: "Secured Demo Area"
@@ -148,8 +148,8 @@ that looks like the following:
148148
* All URLs *not* matching ``/admin/*`` are accessible by all users (and the
149149
user is never prompted to log in).
150150

151-
Let's look briefly at how security works and how each part of the configuration
152-
comes into play.
151+
Read this short summary about how security works and how each part of the
152+
configuration comes into play.
153153

154154
How Security Works: Authentication and Authorization
155155
----------------------------------------------------
@@ -300,11 +300,11 @@ First, enable form login under your firewall:
300300
security:
301301
firewalls:
302302
secured_area:
303-
pattern: ^/
303+
pattern: ^/
304304
anonymous: ~
305305
form_login:
306-
login_path: login
307-
check_path: login_check
306+
login_path: login
307+
check_path: login_check
308308
309309
.. code-block:: xml
310310
@@ -373,10 +373,10 @@ submission (i.e. ``/login_check``):
373373
374374
# app/config/routing.yml
375375
login:
376-
path: /login
377-
defaults: { _controller: AcmeSecurityBundle:Security:login }
376+
path: /login
377+
defaults: { _controller: AcmeSecurityBundle:Security:login }
378378
login_check:
379-
path: /login_check
379+
path: /login_check
380380
381381
.. code-block:: xml
382382
@@ -537,7 +537,7 @@ And that's it! When you submit the form, the security system will automatically
537537
check the user's credentials and either authenticate the user or send the
538538
user back to the login form where the error can be displayed.
539539

540-
Let's review the whole process:
540+
To review the whole process:
541541

542542
#. The user tries to access a resource that is protected;
543543
#. The firewall initiates the authentication process by redirecting the
@@ -633,8 +633,8 @@ see :doc:`/cookbook/security/form_login`.
633633
634634
firewalls:
635635
login_firewall:
636-
pattern: ^/login$
637-
anonymous: ~
636+
pattern: ^/login$
637+
anonymous: ~
638638
secured_area:
639639
pattern: ^/
640640
form_login: ~
@@ -1211,13 +1211,14 @@ aren't stored anywhere in a database. The actual user object is provided
12111211
by Symfony (:class:`Symfony\\Component\\Security\\Core\\User\\User`).
12121212

12131213
.. tip::
1214+
12141215
Any user provider can load users directly from configuration by specifying
12151216
the ``users`` configuration parameter and listing the users beneath it.
12161217

12171218
.. caution::
12181219

12191220
If your username is completely numeric (e.g. ``77``) or contains a dash
1220-
(e.g. ``user-name``), you should use that alternative syntax when specifying
1221+
(e.g. ``user-name``), you should use an alternative syntax when specifying
12211222
users in YAML:
12221223

12231224
.. code-block:: yaml
@@ -1695,8 +1696,6 @@ Access Control
16951696
Now that you have a User and Roles, you can go further than URL-pattern based
16961697
authorization.
16971698

1698-
.. _book-security-securing-controller:
1699-
17001699
Access Control in Controllers
17011700
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
17021701

book/translation.rst

+11-9
Original file line numberDiff line numberDiff line change
@@ -449,8 +449,8 @@ by the routing system using the special ``_locale`` parameter:
449449
.. code-block:: yaml
450450
451451
contact:
452-
path: /{_locale}/contact
453-
defaults: { _controller: AcmeDemoBundle:Contact:index, _locale: en }
452+
path: /{_locale}/contact
453+
defaults: { _controller: AcmeDemoBundle:Contact:index }
454454
requirements:
455455
_locale: en|fr|de
456456
@@ -464,7 +464,6 @@ by the routing system using the special ``_locale`` parameter:
464464
465465
<route id="contact" path="/{_locale}/contact">
466466
<default key="_controller">AcmeDemoBundle:Contact:index</default>
467-
<default key="_locale">en</default>
468467
<requirement key="_locale">en|fr|de</requirement>
469468
</route>
470469
</routes>
@@ -475,12 +474,15 @@ by the routing system using the special ``_locale`` parameter:
475474
use Symfony\Component\Routing\Route;
476475
477476
$collection = new RouteCollection();
478-
$collection->add('contact', new Route('/{_locale}/contact', array(
479-
'_controller' => 'AcmeDemoBundle:Contact:index',
480-
'_locale' => 'en',
481-
), array(
482-
'_locale' => 'en|fr|de',
483-
)));
477+
$collection->add('contact', new Route(
478+
'/{_locale}/contact',
479+
array(
480+
'_controller' => 'AcmeDemoBundle:Contact:index',
481+
),
482+
array(
483+
'_locale' => 'en|fr|de',
484+
)
485+
));
484486
485487
return $collection;
486488

components/config/definition.rst

+8-8
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ applied to it (like: "the value for ``auto_connect`` must be a boolean value"):
2121
default_connection: mysql
2222
connections:
2323
mysql:
24-
host: localhost
25-
driver: mysql
24+
host: localhost
25+
driver: mysql
2626
username: user
2727
password: pass
2828
sqlite:
29-
host: localhost
30-
driver: sqlite
31-
memory: true
29+
host: localhost
30+
driver: sqlite
31+
memory: true
3232
username: user
3333
password: pass
3434
@@ -464,9 +464,9 @@ in this config:
464464
.. code-block:: yaml
465465
466466
connection:
467-
name: my_mysql_connection
468-
host: localhost
469-
driver: mysql
467+
name: my_mysql_connection
468+
host: localhost
469+
driver: mysql
470470
username: user
471471
password: pass
472472

components/console/introduction.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ You can install the component in 2 different ways:
2727
configured with an ANSI driver and your console commands invoke other scripts which
2828
emit ANSI color sequences, they will be shown as raw escape characters.
2929

30-
To enable ANSI colour support for Windows, please install `ANSICON`_.
30+
To enable ANSI color support for Windows, please install `ANSICON`_.
3131

3232
Creating a basic Command
3333
------------------------
@@ -530,4 +530,4 @@ Learn More!
530530
* :doc:`/components/console/events`
531531

532532
.. _Packagist: https://packagist.org/packages/symfony/console
533-
.. _ANSICON: https://github.com/adoxa/ansicon/downloads
533+
.. _ANSICON: https://github.com/adoxa/ansicon/releases

components/dependency_injection/parameters.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,8 @@ making the class of a service a parameter:
134134
135135
services:
136136
mailer:
137-
class: '%mailer.class%'
138-
arguments: ['%mailer.transport%']
137+
class: "%mailer.class%"
138+
arguments: ["%mailer.transport%"]
139139
140140
.. code-block:: xml
141141

components/dependency_injection/parentservices.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ The service config for these classes would look something like this:
6262
my_email_formatter:
6363
# ...
6464
newsletter_manager:
65-
class: "%newsletter_manager.class%"
65+
class: "%newsletter_manager.class%"
6666
calls:
6767
- [setMailer, ["@my_mailer"]]
6868
- [setEmailFormatter, ["@my_email_formatter"]]
@@ -196,7 +196,7 @@ a parent for a service.
196196
- [setEmailFormatter, ["@my_email_formatter"]]
197197
198198
newsletter_manager:
199-
class: "%newsletter_manager.class%"
199+
class: "%newsletter_manager.class%"
200200
parent: mail_manager
201201
202202
greeting_card_manager:
@@ -321,13 +321,13 @@ to the ``NewsletterManager`` class, the config would look like this:
321321
- [setEmailFormatter, ["@my_email_formatter"]]
322322
323323
newsletter_manager:
324-
class: "%newsletter_manager.class%"
324+
class: "%newsletter_manager.class%"
325325
parent: mail_manager
326326
calls:
327327
- [setMailer, ["@my_alternative_mailer"]]
328328
329329
greeting_card_manager:
330-
class: "%greeting_card_manager.class%"
330+
class: "%greeting_card_manager.class%"
331331
parent: mail_manager
332332
333333
.. code-block:: xml

components/dependency_injection/types.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ Another possibility is just setting public fields of the class directly::
184184
my_mailer:
185185
# ...
186186
newsletter_manager:
187-
class: NewsletterManager
187+
class: NewsletterManager
188188
properties:
189189
mailer: "@my_mailer"
190190

components/filesystem.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,8 @@ the mode of a file. The fourth argument is a boolean recursive option::
162162
Remove
163163
~~~~~~
164164

165-
:method:`Symfony\\Component\\Filesystem\\Filesystem::remove` let's you remove
166-
files, symlink, directories easily::
165+
:method:`Symfony\\Component\\Filesystem\\Filesystem::remove` is used to remove
166+
files, symlinks, directories easily::
167167

168168
$fs->remove(array('symlink', '/path/to/directory', 'activity.log'));
169169

components/http_foundation/session_configuration.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Configuring Sessions and Save Handlers
77

88
This section deals with how to configure session management and fine tune it
99
to your specific needs. This documentation covers save handlers, which
10-
store and retrieve session data, and configuring session behaviour.
10+
store and retrieve session data, and configuring session behavior.
1111

1212
Save Handlers
1313
~~~~~~~~~~~~~
@@ -57,7 +57,7 @@ Example usage::
5757

5858
Native save handlers provide a quick solution to session storage, however, in complex systems
5959
where you need more control, custom save handlers may provide more freedom and flexibility.
60-
Symfony2 provides several implementations which you may further customise as required.
60+
Symfony2 provides several implementations which you may further customize as required.
6161

6262
Custom Save Handlers
6363
--------------------

components/routing/introduction.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ In order to set up a basic routing system you need three parts:
2525
* A :class:`Symfony\\Component\\Routing\\RequestContext`, which has information about the request
2626
* A :class:`Symfony\\Component\\Routing\\Matcher\\UrlMatcher`, which performs the mapping of the request to a single route
2727

28-
Let's see a quick example. Notice that this assumes that you've already configured
28+
Here is a quick example. Notice that this assumes that you've already configured
2929
your autoloader to load the Routing component::
3030

3131
use Symfony\Component\Routing\Matcher\UrlMatcher;

components/serializer.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ method on the normalizer definition::
129129
Deserializing an Object
130130
-----------------------
131131

132-
Let's see now how to do the exactly the opposite. This time, the information
132+
You'll now learn how to do the exact opposite. This time, the information
133133
of the ``Person`` class would be encoded in XML format::
134134

135135
$data = <<<EOF

cookbook/assetic/apply_to_option.rst

+8-8
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ How to Apply an Assetic Filter to a Specific File Extension
66

77
Assetic filters can be applied to individual files, groups of files or even,
88
as you'll see here, files that have a specific extension. To show you how
9-
to handle each option, let's suppose that you want to use Assetic's CoffeeScript
9+
to handle each option, suppose that you want to use Assetic's CoffeeScript
1010
filter, which compiles CoffeeScript files into JavaScript.
1111

1212
The main configuration is just the paths to coffee, node and node_modules.
@@ -20,9 +20,9 @@ An example configuration might look like this:
2020
assetic:
2121
filters:
2222
coffee:
23-
bin: /usr/bin/coffee
24-
node: /usr/bin/node
25-
node_paths: [ /usr/lib/node_modules/ ]
23+
bin: /usr/bin/coffee
24+
node: /usr/bin/node
25+
node_paths: [/usr/lib/node_modules/]
2626
2727
.. code-block:: xml
2828
@@ -130,10 +130,10 @@ applied to all ``.coffee`` files:
130130
assetic:
131131
filters:
132132
coffee:
133-
bin: /usr/bin/coffee
134-
node: /usr/bin/node
135-
node_paths: [ /usr/lib/node_modules/ ]
136-
apply_to: "\.coffee$"
133+
bin: /usr/bin/coffee
134+
node: /usr/bin/node
135+
node_paths: [/usr/lib/node_modules/]
136+
apply_to: "\.coffee$"
137137
138138
.. code-block:: xml
139139

0 commit comments

Comments
 (0)