Skip to content

Commit d46f18f

Browse files
committed
Merge branch '2.1' into 2.2
2 parents f2b48c7 + ce77e1a commit d46f18f

34 files changed

+890
-62
lines changed

book/controller.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,14 @@ working with forms, for example::
332332
.. index::
333333
single: Controller; Base controller class
334334

335+
Creating Static Pages
336+
---------------------
337+
338+
You can create a static page without even creating a controller (only a route
339+
and template are needed).
340+
341+
Use it! See :doc:`/cookbook/templating/render_without_controller`.
342+
335343
The Base Controller Class
336344
-------------------------
337345

book/doctrine.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1313,7 +1313,7 @@ the current date, only when the entity is first persisted (i.e. inserted):
13131313
type: entity
13141314
# ...
13151315
lifecycleCallbacks:
1316-
prePersist: [ setCreatedValue ]
1316+
prePersist: [setCreatedValue]
13171317
13181318
.. code-block:: xml
13191319

book/installation.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,8 +294,10 @@ Symfony2 should welcome and congratulate you for your hard work so far!
294294
this is not required for development it is recommended at the time your
295295
application goes into production as all system and configuration files
296296
become inaccessible to clients then. For information on configuring
297-
your specific web server document root, see the following
298-
documentation: `Apache`_ | `Nginx`_ .
297+
your specific web server document root, read
298+
:doc:`/cookbook/configuration/web_server_configuration`
299+
or consult the official documentation of your webserver:
300+
`Apache`_ | `Nginx`_ .
299301

300302
Beginning Development
301303
---------------------

book/page_creation.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,8 @@ the same basic and recommended directory structure:
439439

440440
* ``web/``: This is the web root directory and contains any publicly accessible files;
441441

442+
.. _the-web-directory:
443+
442444
The Web Directory
443445
~~~~~~~~~~~~~~~~~
444446

book/routing.rst

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -770,6 +770,7 @@ a slash. URLs matching this route might look like:
770770

771771
* ``/articles/en/2010/my-post``
772772
* ``/articles/fr/2010/my-post.rss``
773+
* ``/articles/en/2013/my-latest-post.html``
773774

774775
.. _book-routing-format-param:
775776

@@ -1062,7 +1063,7 @@ the command by running the following from the root of your project.
10621063
10631064
$ php app/console router:debug
10641065
1065-
The command will print a helpful list of *all* the configured routes in
1066+
This command will print a helpful list of *all* the configured routes in
10661067
your application:
10671068

10681069
.. code-block:: text
@@ -1081,16 +1082,18 @@ the route name after the command:
10811082
10821083
$ php app/console router:debug article_show
10831084
1084-
.. versionadded:: 2.1
1085-
The ``router:match`` command was added in Symfony 2.1
1086-
1087-
You can check which, if any, route matches a path with the ``router:match``
1088-
console command:
1085+
Likewise, if you want to test whether a URL matches a given route, you can
1086+
use the ``router:match`` console command:
10891087

10901088
.. code-block:: bash
10911089
1092-
$ php app/console router:match /articles/en/2012/article.rss
1093-
Route "article_show" matches
1090+
$ php app/console router:match /blog/my-latest-post
1091+
1092+
This command will print which route the URL matches.
1093+
1094+
.. code-block:: text
1095+
1096+
Route "blog_show" matches
10941097
10951098
.. index::
10961099
single: Routing; Generating URLs

book/service_container.rst

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ straightforward. Parameters make defining services more organized and flexible:
192192
services:
193193
my_mailer:
194194
class: "%my_mailer.class%"
195-
arguments: [%my_mailer.transport%]
195+
arguments: ["%my_mailer.transport%"]
196196
197197
.. code-block:: xml
198198
@@ -244,6 +244,23 @@ looks up the value of each parameter and uses it in the service definition.
244244
# This will be parsed as string "@securepass"
245245
mailer_password: "@@securepass"
246246
247+
.. note::
248+
249+
The percent sign inside a parameter or argument, as part of the string, must
250+
be escaped with another percent sign:
251+
252+
.. code-block:: xml
253+
254+
<argument type="string">http://symfony.com/?foo=%%s&bar=%%d</argument>
255+
256+
.. caution::
257+
258+
You may receive a
259+
:class:`Symfony\\Component\\DependencyInjection\\Exception\\ScopeWideningInjectionException`
260+
when passing the ``request`` service as an argument. To understand this
261+
problem better and learn how to solve it, refer to the cookbook article
262+
:doc:`/cookbook/service_container/scopes`.
263+
247264
The purpose of parameters is to feed information into services. Of course
248265
there was nothing wrong with defining the service without using any parameters.
249266
Parameters, however, have several advantages:
@@ -318,7 +335,7 @@ directories don't exist, create them.
318335
services:
319336
my_mailer:
320337
class: "%my_mailer.class%"
321-
arguments: [%my_mailer.transport%]
338+
arguments: ["%my_mailer.transport%"]
322339
323340
.. code-block:: xml
324341
@@ -358,7 +375,7 @@ configuration.
358375
359376
# app/config/config.yml
360377
imports:
361-
- { resource: @AcmeHelloBundle/Resources/config/services.yml }
378+
- { resource: "@AcmeHelloBundle/Resources/config/services.yml" }
362379
363380
.. code-block:: xml
364381
@@ -557,7 +574,7 @@ the service container gives you a much more appealing option:
557574
# ...
558575
newsletter_manager:
559576
class: "%newsletter_manager.class%"
560-
arguments: [@my_mailer]
577+
arguments: ["@my_mailer"]
561578
562579
.. code-block:: xml
563580
@@ -648,7 +665,7 @@ Injecting the dependency by the setter method just needs a change of syntax:
648665
newsletter_manager:
649666
class: "%newsletter_manager.class%"
650667
calls:
651-
- [ setMailer, [ @my_mailer ] ]
668+
- [setMailer, ["@my_mailer"]]
652669
653670
.. code-block:: xml
654671
@@ -715,7 +732,7 @@ it exists and do nothing if it doesn't:
715732
services:
716733
newsletter_manager:
717734
class: "%newsletter_manager.class%"
718-
arguments: [@?my_mailer]
735+
arguments: ["@?my_mailer"]
719736
720737
.. code-block:: xml
721738
@@ -820,7 +837,7 @@ Configuring the service container is easy:
820837
services:
821838
newsletter_manager:
822839
class: "%newsletter_manager.class%"
823-
arguments: [@mailer, @templating]
840+
arguments: ["@mailer", "@templating"]
824841
825842
.. code-block:: xml
826843

components/dependency_injection/factories.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ in the previous example takes the ``templating`` service as an argument:
162162
factory_service: newsletter_factory
163163
factory_method: get
164164
arguments:
165-
- @templating
165+
- "@templating"
166166
167167
.. code-block:: xml
168168

components/dependency_injection/introduction.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,11 +236,11 @@ config files:
236236
services:
237237
mailer:
238238
class: Mailer
239-
arguments: [%mailer.transport%]
239+
arguments: ["%mailer.transport%"]
240240
newsletter_manager:
241241
class: NewsletterManager
242242
calls:
243-
- [ setMailer, [ @mailer ] ]
243+
- [setMailer, ["@mailer"]]
244244
245245
.. code-block:: xml
246246

components/dependency_injection/parentservices.rst

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,14 @@ The service config for these classes would look something like this:
6464
newsletter_manager:
6565
class: "%newsletter_manager.class%"
6666
calls:
67-
- [ setMailer, [ @my_mailer ] ]
68-
- [ setEmailFormatter, [ @my_email_formatter] ]
67+
- [setMailer, ["@my_mailer"]]
68+
- [setEmailFormatter, ["@my_email_formatter"]]
6969
7070
greeting_card_manager:
7171
class: "%greeting_card_manager.class%"
7272
calls:
73-
- [ setMailer, [ @my_mailer ] ]
74-
- [ setEmailFormatter, [ @my_email_formatter] ]
73+
- [setMailer, ["@my_mailer"]]
74+
- [setEmailFormatter, ["@my_email_formatter"]]
7575
7676
.. code-block:: xml
7777
@@ -192,8 +192,8 @@ a parent for a service.
192192
mail_manager:
193193
abstract: true
194194
calls:
195-
- [ setMailer, [ @my_mailer ] ]
196-
- [ setEmailFormatter, [ @my_email_formatter] ]
195+
- [setMailer, ["@my_mailer"]]
196+
- [setEmailFormatter, ["@my_email_formatter"]]
197197
198198
newsletter_manager:
199199
class: "%newsletter_manager.class%"
@@ -312,15 +312,26 @@ to the ``NewsletterManager`` class, the config would look like this:
312312
mail_manager:
313313
abstract: true
314314
calls:
315+
<<<<<<< HEAD
315316
- [ setMailer, [ @my_mailer ] ]
316317
- [ setEmailFormatter, [ @my_email_formatter] ]
317318

319+
=======
320+
- [setMailer, ["@my_mailer"]]
321+
- [setEmailFormatter, ["@my_email_formatter"]]
322+
323+
>>>>>>> e1ae126cb094754b7f4e72bbdb4388fed7f2d188
318324
newsletter_manager:
319325
class: "%newsletter_manager.class%"
320326
parent: mail_manager
321327
calls:
328+
<<<<<<< HEAD
322329
- [ setMailer, [ @my_alternative_mailer ] ]
323330

331+
=======
332+
- [setMailer, ["@my_alternative_mailer"]]
333+
334+
>>>>>>> e1ae126cb094754b7f4e72bbdb4388fed7f2d188
324335
greeting_card_manager:
325336
class: "%greeting_card_manager.class%"
326337
parent: mail_manager
@@ -439,14 +450,24 @@ If you had the following config:
439450
mail_manager:
440451
abstract: true
441452
calls:
453+
<<<<<<< HEAD
442454
- [ setFilter, [ @my_filter ] ]
443455

456+
=======
457+
- [setFilter, ["@my_filter"]]
458+
459+
>>>>>>> e1ae126cb094754b7f4e72bbdb4388fed7f2d188
444460
newsletter_manager:
445461
class: "%newsletter_manager.class%"
446462
parent: mail_manager
447463
calls:
464+
<<<<<<< HEAD
448465
- [ setFilter, [ @another_filter ] ]
449466

467+
=======
468+
- [setFilter, ["@another_filter"]]
469+
470+
>>>>>>> e1ae126cb094754b7f4e72bbdb4388fed7f2d188
450471
.. code-block:: xml
451472
452473
<parameters>

components/dependency_injection/tags.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ For example you may add the following transports as services:
7979
acme_mailer.transport.smtp:
8080
class: \Swift_SmtpTransport
8181
arguments:
82-
- %mailer_host%
82+
- "%mailer_host%"
8383
tags:
8484
- { name: acme_mailer.transport }
8585
acme_mailer.transport.sendmail:
@@ -219,7 +219,7 @@ To answer this, change the service declaration:
219219
acme_mailer.transport.smtp:
220220
class: \Swift_SmtpTransport
221221
arguments:
222-
- %mailer_host%
222+
- "%mailer_host%"
223223
tags:
224224
- { name: acme_mailer.transport, alias: foo }
225225
acme_mailer.transport.sendmail:

components/dependency_injection/types.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ service container configuration:
4343
# ...
4444
newsletter_manager:
4545
class: NewsletterManager
46-
arguments: [@my_mailer]
46+
arguments: ["@my_mailer"]
4747
4848
.. code-block:: xml
4949
@@ -119,7 +119,7 @@ accepts the dependency::
119119
newsletter_manager:
120120
class: NewsletterManager
121121
calls:
122-
- [ setMailer, [ @my_mailer ] ]
122+
- [setMailer, ["@my_mailer"]]
123123
124124
.. code-block:: xml
125125
@@ -186,7 +186,7 @@ Another possibility is just setting public fields of the class directly::
186186
newsletter_manager:
187187
class: NewsletterManager
188188
properties:
189-
mailer: @my_mailer
189+
mailer: "@my_mailer"
190190
191191
.. code-block:: xml
192192

components/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ The Components
1717
http_foundation/index
1818
http_kernel/index
1919
locale
20+
options_resolver
2021
process
2122
property_access/index
2223
routing/index

components/map.rst.inc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@
7070

7171
* :doc:`/components/locale`
7272

73+
* **Options Resolver**
74+
75+
* :doc:`/components/options_resolver`
76+
7377
* **Process**
7478

7579
* :doc:`/components/process`

0 commit comments

Comments
 (0)