Skip to content

Commit 2b97bbe

Browse files
committedNov 27, 2013
Merge branch '2.3' into 2.4
Conflicts: book/translation.rst cookbook/configuration/pdo_session_storage.rst
2 parents 55a2de4 + 36ed7b9 commit 2b97bbe

32 files changed

+89
-82
lines changed
 

‎cookbook/assetic/apply_to_option.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ work as the regular JavaScript files will not survive the CoffeeScript compilati
119119

120120
This problem can be avoided by using the ``apply_to`` option in the config,
121121
which allows you to specify that a filter should always be applied to particular
122-
file extensions. In this case you can specify that the Coffee filter is
122+
file extensions. In this case you can specify that the ``coffee`` filter is
123123
applied to all ``.coffee`` files:
124124

125125
.. configuration-block::

‎cookbook/assetic/asset_management.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ in your source, you'll likely just see something like this:
352352

353353
.. code-block:: html
354354

355-
<script src="/app_dev.php/js/abcd123.js"></script>
355+
<script src="/js/abcd123.js"></script>
356356

357357
Moreover, that file does **not** actually exist, nor is it dynamically rendered
358358
by Symfony (as the asset files are in the ``dev`` environment). This is on

‎cookbook/assetic/uglifyjs.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ your JavaScripts:
104104
It should output a folder on your system, inside which you should find
105105
the UglifyJS executable.
106106

107-
If you installed UglifyJS locally, you can find the bin folder inside
107+
If you installed UglifyJS locally, you can find the ``bin`` folder inside
108108
the ``node_modules`` folder. It's called ``.bin`` in this case.
109109

110110
You now have access to the ``uglifyjs2`` filter in your application.
@@ -175,7 +175,7 @@ and :ref:`dump your assetic assets <cookbook-asetic-dump-prod>`.
175175
.. tip::
176176

177177
Instead of adding the filter to the asset tags, you can also globally
178-
enable it by adding the apply-to attribute to the filter configuration, for
178+
enable it by adding the ``apply_to`` attribute to the filter configuration, for
179179
example in the ``uglifyjs2`` filter ``apply_to: "\.js$"``. To only have
180180
the filter applied in production, add this to the ``config_prod`` file
181181
rather than the common config file. For details on applying filters by

‎cookbook/assetic/yuicompressor.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,9 @@ apply this filter when debug mode is off.
156156
.. tip::
157157

158158
Instead of adding the filter to the asset tags, you can also globally
159-
enable it by adding the apply-to attribute to the filter configuration, for
160-
example in the yui_js filter ``apply_to: "\.js$"``. To only have the filter
161-
applied in production, add this to the config_prod file rather than the
159+
enable it by adding the ``apply_to`` attribute to the filter configuration, for
160+
example in the ``yui_js`` filter ``apply_to: "\.js$"``. To only have the filter
161+
applied in production, add this to the ``config_prod`` file rather than the
162162
common config file. For details on applying filters by file extension,
163163
see :ref:`cookbook-assetic-apply-to`.
164164

‎cookbook/bundles/best_practices.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class name.
5656
.. note::
5757

5858
Symfony2 core Bundles do not prefix the Bundle class with ``Symfony``
59-
and always add a ``Bundle`` subnamespace; for example:
59+
and always add a ``Bundle`` sub-namespace; for example:
6060
:class:`Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle`.
6161

6262
Each bundle has an alias, which is the lower-cased short version of the bundle

‎cookbook/bundles/extension.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ The second method has several specific advantages:
7070
* Much more powerful than simply defining parameters: a specific option value
7171
might trigger the creation of many service definitions;
7272

73-
* Ability to have configuration hierarchy
73+
* Ability to have configuration hierarchy;
7474

7575
* Smart merging when several configuration files (e.g. ``config_dev.yml``
7676
and ``config.yml``) override each other's configuration;

‎cookbook/bundles/installation.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ this happens, you can try a different version.
3636
Now you can add the bundle to your ``composer.json`` file and update the
3737
dependencies. You can do this manually:
3838

39-
1. **Add it to the composer.json file:**
39+
1. **Add it to the ``composer.json`` file:**
4040

4141
.. code-block:: json
4242
@@ -132,7 +132,7 @@ Other Setup
132132
-----------
133133

134134
At this point, check the ``README`` file of your brand new bundle to see
135-
what do to next.
135+
what to do next.
136136

137137
.. _their documentation: http://getcomposer.org/doc/00-intro.md
138138
.. _Packagist: https://packagist.org

‎cookbook/bundles/remove.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Remove the ``_acme_demo`` entry at the bottom of this file.
5656

5757
Some bundles contain configuration in one of the ``app/config/config*.yml``
5858
files. Be sure to remove the related configuration from these files. You can
59-
quickly spot bundle configuration by looking at a ``acme_demo`` (or whatever
59+
quickly spot bundle configuration by looking for a ``acme_demo`` (or whatever
6060
the name of the bundle is, e.g. ``fos_user`` for the FOSUserBundle) string in
6161
the configuration files.
6262

‎cookbook/configuration/apache_router.rst

+6-6
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,14 @@ Symfony2 to use the ``ApacheUrlMatcher`` instead of the default one:
4545

4646
Note that :class:`Symfony\\Component\\Routing\\Matcher\\ApacheUrlMatcher`
4747
extends :class:`Symfony\\Component\\Routing\\Matcher\\UrlMatcher` so even
48-
if you don't regenerate the url_rewrite rules, everything will work (because
48+
if you don't regenerate the mod_rewrite rules, everything will work (because
4949
at the end of ``ApacheUrlMatcher::match()`` a call to ``parent::match()``
5050
is done).
5151

5252
Generating mod_rewrite rules
5353
----------------------------
5454

55-
To test that it's working, let's create a very basic route for demo bundle:
55+
To test that it's working, let's create a very basic route for the AcmeDemoBundle:
5656

5757
.. configuration-block::
5858

@@ -77,7 +77,7 @@ To test that it's working, let's create a very basic route for demo bundle:
7777
'_controller' => 'AcmeDemoBundle:Demo:hello',
7878
)));
7979
80-
Now generate **url_rewrite** rules:
80+
Now generate the mod_rewrite rules:
8181

8282
.. code-block:: bash
8383
@@ -95,7 +95,7 @@ Which should roughly output the following:
9595
RewriteCond %{REQUEST_URI} ^/hello/([^/]+?)$
9696
RewriteRule .* app.php [QSA,L,E=_ROUTING__route:hello,E=_ROUTING_name:%1,E=_ROUTING__controller:AcmeDemoBundle\:Demo\:hello]
9797
98-
You can now rewrite `web/.htaccess` to use the new rules, so with this example
98+
You can now rewrite ``web/.htaccess`` to use the new rules, so with this example
9999
it should look like this:
100100

101101
.. code-block:: apache
@@ -114,10 +114,10 @@ it should look like this:
114114
115115
.. note::
116116

117-
Procedure above should be done each time you add/change a route if you want to take full advantage of this setup
117+
The procedure above should be done each time you add/change a route if you want to take full advantage of this setup.
118118

119119
That's it!
120-
You're now all set to use Apache Route rules.
120+
You're now all set to use Apache routes.
121121

122122
Additional tweaks
123123
-----------------

‎cookbook/configuration/environments.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -333,10 +333,10 @@ includes the following:
333333
* ``appDevDebugProjectContainer.php`` - the cached "service container" that
334334
represents the cached application configuration;
335335

336-
* ``appdevUrlGenerator.php`` - the PHP class generated from the routing
336+
* ``appDevUrlGenerator.php`` - the PHP class generated from the routing
337337
configuration and used when generating URLs;
338338

339-
* ``appdevUrlMatcher.php`` - the PHP class used for route matching - look
339+
* ``appDevUrlMatcher.php`` - the PHP class used for route matching - look
340340
here to see the compiled regular expression logic used to match incoming
341341
URLs to different routes;
342342

‎cookbook/configuration/external_parameters.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,8 @@ in the container. The following imports a file named ``parameters.php``.
133133
closure resources are all supported by the ``imports`` directive.
134134

135135
In ``parameters.php``, tell the service container the parameters that you wish
136-
to set. This is useful when important configuration is in a nonstandard
137-
format. The example below includes a Drupal database's configuration in
136+
to set. This is useful when important configuration is in a non-standard
137+
format. The example below includes a Drupal database configuration in
138138
the Symfony service container.
139139

140140
.. code-block:: php

‎cookbook/configuration/front_controllers_and_kernel.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ independently (for example, the admin UI, the frontend UI and database migration
141141
The Environments
142142
----------------
143143

144-
We just mentioned another method the ``AppKernel`` has to implement -
144+
As just mentioned, the ``AppKernel`` has to implement another method -
145145
:method:`Symfony\\Component\\HttpKernel\\KernelInterface::registerContainerConfiguration`.
146146
This method is responsible for loading the application's
147147
configuration from the right *environment*.

‎cookbook/configuration/pdo_session_storage.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ database for the session data.
127127

128128
But if you'd like to store the session data in the same database as the rest
129129
of your project's data, you can use the connection settings from the
130-
parameter.ini by referencing the database-related parameters defined there:
130+
``parameters.yml`` file by referencing the database-related parameters defined there:
131131

132132
.. configuration-block::
133133

‎cookbook/configuration/web_server_configuration.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ are:
4040

4141
For performance reasons, you will probably want to set
4242
``AllowOverride None`` and implement the rewrite rules in the ``web/.htaccess``
43-
into the virtualhost config.
43+
into the ``VirtualHost`` config.
4444

4545
If you are using **php-cgi**, Apache does not pass HTTP basic username and
4646
password to PHP by default. To work around this limitation, you should use the
@@ -53,7 +53,7 @@ following configuration snippet:
5353
.. caution::
5454

5555
In Apache 2.4, ``Order allow,deny`` has been replaced by ``Require all granted``,
56-
and hence you need to modify your Directory permission settings as follows:
56+
and hence you need to modify your ``Directory`` permission settings as follows:
5757

5858
.. code-block:: apache
5959

‎cookbook/console/console_command.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ How to create a Console Command
55
===============================
66

77
The Console page of the Components section (:doc:`/components/console/introduction`) covers
8-
how to create a Console command. This cookbook article covers the differences
9-
when creating Console commands within the Symfony2 framework.
8+
how to create a console command. This cookbook article covers the differences
9+
when creating console commands within the Symfony2 framework.
1010

1111
Automatically Registering Commands
1212
----------------------------------

‎cookbook/console/logging.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -184,15 +184,15 @@ method, where exception handling should happen:
184184
}
185185
186186
In the code above, you disable exception catching so the parent ``run`` method
187-
will throw all exceptions. When an exception is caught, you simple log it by
187+
will throw all exceptions. When an exception is caught, you simply log it by
188188
accessing the ``logger`` service from the service container and then handle
189189
the rest of the logic in the same way that the parent ``run`` method does
190190
(specifically, since the parent :method:`run <Symfony\\Bundle\\FrameworkBundle\\Console\\Application::run>`
191191
method will not handle exceptions rendering and status code handling when
192192
``catchExceptions`` is set to false, it has to be done in the overridden
193193
method).
194194

195-
For the extended Application class to work properly with in console shell mode,
195+
For the extended ``Application`` class to work properly with in console shell mode,
196196
you have to do a small trick to intercept the ``autoExit`` setter and store the
197197
setting in a different property, since the parent property is private.
198198

‎cookbook/console/usage.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ stack framework, some additional global options are available as well.
1111
By default, console commands run in the ``dev`` environment and you may want
1212
to change this for some commands. For example, you may want to run some commands
1313
in the ``prod`` environment for performance reasons. Also, the result of some commands
14-
will be different depending on the environment. for example, the ``cache:clear``
14+
will be different depending on the environment. For example, the ``cache:clear``
1515
command will clear and warm the cache for the specified environment only. To
1616
clear and warm the ``prod`` cache you need to run:
1717

‎cookbook/email/dev_environment.rst

+7-7
Original file line numberDiff line numberDiff line change
@@ -136,13 +136,6 @@ Instead, you can set the ``intercept_redirects`` option to ``true`` in the
136136
``config_dev.yml`` file, which will cause the redirect to stop and allow
137137
you to open the report with details of the sent emails.
138138

139-
.. tip::
140-
141-
Alternatively, you can open the profiler after the redirect and search
142-
by the submit URL used on previous request (e.g. ``/contact/handle``).
143-
The profiler's search feature allows you to load the profiler information
144-
for any past requests.
145-
146139
.. configuration-block::
147140

148141
.. code-block:: yaml
@@ -171,3 +164,10 @@ you to open the report with details of the sent emails.
171164
$container->loadFromExtension('web_profiler', array(
172165
'intercept_redirects' => 'true',
173166
));
167+
168+
.. tip::
169+
170+
Alternatively, you can open the profiler after the redirect and search
171+
by the submit URL used on the previous request (e.g. ``/contact/handle``).
172+
The profiler's search feature allows you to load the profiler information
173+
for any past requests.

‎cookbook/form/create_custom_field_type.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Defining the Field Type
1616

1717
In order to create the custom field type, first you have to create the class
1818
representing the field. In this situation the class holding the field type
19-
will be called `GenderType` and the file will be stored in the default location
19+
will be called ``GenderType`` and the file will be stored in the default location
2020
for form fields, which is ``<BundleName>\Form\Type``. Make sure the field extends
2121
:class:`Symfony\\Component\\Form\\AbstractType`::
2222

‎cookbook/form/create_form_type_extension.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ database)::
178178
Your form type extension class will need to do two things in order to extend
179179
the ``file`` form type:
180180

181-
#. Override the ``setDefaultOptions`` method in order to add an image_path
181+
#. Override the ``setDefaultOptions`` method in order to add an ``image_path``
182182
option;
183183
#. Override the ``buildForm`` and ``buildView`` methods in order to pass the image
184184
URL to the view.

‎cookbook/form/data_transformers.rst

+13-14
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ This is where Data Transformers come into play.
2020
Creating the Transformer
2121
------------------------
2222

23-
First, create an `IssueToNumberTransformer` class - this class will be responsible
24-
for converting to and from the issue number and the Issue object::
23+
First, create an ``IssueToNumberTransformer`` class - this class will be responsible
24+
for converting to and from the issue number and the ``Issue`` object::
2525

2626
// src/Acme/TaskBundle/Form/DataTransformer/IssueToNumberTransformer.php
2727
namespace Acme\TaskBundle\Form\DataTransformer;
@@ -129,17 +129,16 @@ issue field in some form.
129129

130130
public function setDefaultOptions(OptionsResolverInterface $resolver)
131131
{
132-
$resolver->setDefaults(array(
133-
'data_class' => 'Acme\TaskBundle\Entity\Task',
134-
));
135-
136-
$resolver->setRequired(array(
137-
'em',
138-
));
139-
140-
$resolver->setAllowedTypes(array(
141-
'em' => 'Doctrine\Common\Persistence\ObjectManager',
142-
));
132+
$resolver
133+
->setDefaults(array(
134+
'data_class' => 'Acme\TaskBundle\Entity\Task',
135+
))
136+
->setRequired(array(
137+
'em',
138+
))
139+
->setAllowedTypes(array(
140+
'em' => 'Doctrine\Common\Persistence\ObjectManager',
141+
));
143142

144143
// ...
145144
}
@@ -234,7 +233,7 @@ In the above example, you applied the transformer to a normal ``text`` field.
234233
This was easy, but has two downsides:
235234

236235
1) You need to always remember to apply the transformer whenever you're adding
237-
a field for issue numbers
236+
a field for issue numbers.
238237

239238
2) You need to worry about passing in the ``em`` option whenever you're creating
240239
a form that uses the transformer.

‎cookbook/form/dynamic_form_modification.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,9 @@ flexibility to your forms.
8383
Adding An Event Subscriber To A Form Class
8484
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
8585

86-
So, instead of directly adding that "name" widget via your ProductType form
86+
So, instead of directly adding that "name" widget via your ``ProductType`` form
8787
class, let's delegate the responsibility of creating that particular field
88-
to an Event Subscriber::
88+
to an event subscriber::
8989

9090
// src/Acme/DemoBundle/Form/Type/ProductType.php
9191
namespace Acme\DemoBundle\Form\Type;
@@ -237,7 +237,7 @@ done in the constructor::
237237
Customizing the Form Type
238238
~~~~~~~~~~~~~~~~~~~~~~~~~
239239

240-
Now that you have all the basics in place you an take advantage of the ``securityContext``
240+
Now that you have all the basics in place you can take advantage of the ``SecurityContext``
241241
and fill in the listener logic::
242242

243243
// src/Acme/DemoBundle/FormType/FriendMessageFormType.php

‎cookbook/form/form_collections.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ When the user submits the form, the submitted data for the ``tags`` field are
237237
used to construct an ``ArrayCollection`` of ``Tag`` objects, which is then set
238238
on the ``tag`` field of the ``Task`` instance.
239239

240-
The ``Tags`` collection is accessible naturally via ``$task->getTags()``
240+
The ``tags`` collection is accessible naturally via ``$task->getTags()``
241241
and can be persisted to the database or used however you need.
242242

243243
So far, this works great, but this doesn't allow you to dynamically add new
@@ -407,7 +407,7 @@ one example:
407407
408408
.. note::
409409

410-
It is better to separate your javascript in real JavaScript files than
410+
It is better to separate your JavaScript in real JavaScript files than
411411
to write it inside the HTML as is done here.
412412

413413
Now, each time a user clicks the ``Add a tag`` link, a new sub form will

0 commit comments

Comments
 (0)