Skip to content

Commit d6a17e7

Browse files
committed
Merge branch '2.3' into 2.4
2 parents fc28453 + 04cf9f8 commit d6a17e7

40 files changed

+247
-83
lines changed

book/controller.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ object that's returned from that controller::
475475
return $response;
476476
}
477477

478-
Notice that the `forward()` method uses the same string representation of
478+
Notice that the ``forward()`` method uses the same string representation of
479479
the controller used in the routing configuration. In this case, the target
480480
controller class will be ``HelloController`` inside some ``AcmeHelloBundle``.
481481
The array passed to the method becomes the arguments on the resulting controller.
@@ -794,7 +794,7 @@ The Request Object
794794
Besides the values of the routing placeholders, the controller also has access
795795
to the ``Request`` object. The framework injects the ``Request`` object in the
796796
controller if a variable is type-hinted with
797-
`Symfony\Component\HttpFoundation\Request`::
797+
:class:`Symfony\\Component\\HttpFoundation\\Request`::
798798

799799
use Symfony\Component\HttpFoundation\Request;
800800

book/forms.rst

+6-6
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ these cases you can set the ``validation_groups`` option to ``false``::
495495
Note that when you do that, the form will still run basic integrity checks,
496496
for example whether an uploaded file was too large or whether non-existing
497497
fields were submitted. If you want to suppress validation, you can use the
498-
:ref:`POST_SUBMIT event <cookbook-dynamic-form-modification-suppressing-form-validation>`
498+
:ref:`POST_SUBMIT event <cookbook-dynamic-form-modification-suppressing-form-validation>`.
499499

500500
.. index::
501501
single: Forms; Validation groups based on submitted data
@@ -1811,7 +1811,7 @@ an array.
18111811
18121812
$this->get('request')->request->get('name');
18131813
1814-
Be advised, however, that in most cases using the getData() method is
1814+
Be advised, however, that in most cases using the ``getData()`` method is
18151815
a better choice, since it returns the data (usually an object) after
18161816
it's been transformed by the form framework.
18171817
@@ -1853,7 +1853,7 @@ but here's a short example:
18531853
18541854
.. tip::
18551855
1856-
If you are using Validation Groups, you need to either reference the
1856+
If you are using validation groups, you need to either reference the
18571857
``Default`` group when creating the form, or set the correct group on
18581858
the constraint you are adding.
18591859
@@ -1891,7 +1891,7 @@ Learn more from the Cookbook
18911891
18921892
.. _`Symfony2 Form component`: https://github.com./symfony/Form
18931893
.. _`DateTime`: http://php.net/manual/en/class.datetime.php
1894-
.. _`Twig Bridge`: https://github.com./symfony/symfony/tree/2.2/src/Symfony/Bridge/Twig
1895-
.. _`form_div_layout.html.twig`: https://github.com./symfony/symfony/blob/2.2/src/Symfony/Bridge/Twig/Resources/views/Form/form_div_layout.html.twig
1894+
.. _`Twig Bridge`: https://github.com./symfony/symfony/tree/2.3/src/Symfony/Bridge/Twig
1895+
.. _`form_div_layout.html.twig`: https://github.com./symfony/symfony/blob/2.3/src/Symfony/Bridge/Twig/Resources/views/Form/form_div_layout.html.twig
18961896
.. _`Cross-site request forgery`: http://en.wikipedia.org/wiki/Cross-site_request_forgery
1897-
.. _`view on GitHub`: https://github.com./symfony/symfony/tree/2.2/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form
1897+
.. _`view on GitHub`: https://github.com./symfony/symfony/tree/2.3/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form

book/security.rst

+9-3
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@ authentication (i.e. the old-school username/password box):
5151
realm: "Secured Demo Area"
5252
5353
access_control:
54-
- { path: ^/admin, roles: ROLE_ADMIN }
54+
- { path: ^/admin/, roles: ROLE_ADMIN }
55+
# Include the following line to also secure the /admin path itself
56+
# - { path: ^/admin$, roles: ROLE_ADMIN }
5557
5658
providers:
5759
in_memory:
@@ -79,7 +81,9 @@ authentication (i.e. the old-school username/password box):
7981
</firewall>
8082
8183
<access-control>
82-
<rule path="^/admin" role="ROLE_ADMIN" />
84+
<rule path="^/admin/" role="ROLE_ADMIN" />
85+
<!-- Include the following line to also secure the /admin path itself -->
86+
<!-- <rule path="^/admin$" role="ROLE_ADMIN" /> -->
8387
</access-control>
8488
8589
<provider name="in_memory">
@@ -108,7 +112,9 @@ authentication (i.e. the old-school username/password box):
108112
),
109113
),
110114
'access_control' => array(
111-
array('path' => '^/admin', 'role' => 'ROLE_ADMIN'),
115+
array('path' => '^/admin/', 'role' => 'ROLE_ADMIN'),
116+
// Include the following line to also secure the /admin path itself
117+
// array('path' => '^/admin$', 'role' => 'ROLE_ADMIN'),
112118
),
113119
'providers' => array(
114120
'in_memory' => array(

book/service_container.rst

+3-5
Original file line numberDiff line numberDiff line change
@@ -1146,12 +1146,10 @@ with ``twig.extension`` and automatically registers them as extensions.
11461146
Tags, then, are a way to tell Symfony2 or other third-party bundles that
11471147
your service should be registered or used in some special way by the bundle.
11481148

1149-
The following is a list of tags available with the core Symfony2 bundles.
1150-
Each of these has a different effect on your service and many tags require
1151-
additional arguments (beyond just the ``name`` parameter).
1152-
11531149
For a list of all the tags available in the core Symfony Framework, check
1154-
out :doc:`/reference/dic_tags`.
1150+
out :doc:`/reference/dic_tags`. Each of these has a different effect on your
1151+
service and many tags require additional arguments (beyond just the ``name``
1152+
parameter).
11551153

11561154
Debugging Services
11571155
------------------

book/templating.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -1036,14 +1036,14 @@ stylesheets and JavaScripts that you'll need throughout your site:
10361036
{# ... #}
10371037

10381038
{% block stylesheets %}
1039-
<link href="{{ asset('/css/main.css') }}" rel="stylesheet" />
1039+
<link href="{{ asset('css/main.css') }}" rel="stylesheet" />
10401040
{% endblock %}
10411041
</head>
10421042
<body>
10431043
{# ... #}
10441044

10451045
{% block javascripts %}
1046-
<script src="{{ asset('/js/main.js') }}"></script>
1046+
<script src="{{ asset('js/main.js') }}"></script>
10471047
{% endblock %}
10481048
</body>
10491049
</html>
@@ -1061,7 +1061,7 @@ page. From inside that contact page's template, do the following:
10611061
{% block stylesheets %}
10621062
{{ parent() }}
10631063

1064-
<link href="{{ asset('/css/contact.css') }}" rel="stylesheet" />
1064+
<link href="{{ asset('css/contact.css') }}" rel="stylesheet" />
10651065
{% endblock %}
10661066

10671067
{# ... #}
@@ -1326,7 +1326,7 @@ covered:
13261326
{% endfor %}
13271327
{% endblock %}
13281328

1329-
Notice that this template extends the section template -(``AcmeBlogBundle::layout.html.twig``)
1329+
Notice that this template extends the section template (``AcmeBlogBundle::layout.html.twig``)
13301330
which in-turn extends the base application layout (``::base.html.twig``).
13311331
This is the common three-level inheritance model.
13321332

book/translation.rst

+5-4
Original file line numberDiff line numberDiff line change
@@ -546,8 +546,8 @@ use somewhere in your application::
546546
}
547547

548548
Add constraints though any of the supported methods. Set the message option to the
549-
translation source text. For example, to guarantee that the $name property is not
550-
empty, add the following:
549+
translation source text. For example, to guarantee that the ``$name`` property is
550+
not empty, add the following:
551551

552552
.. configuration-block::
553553

@@ -646,8 +646,8 @@ Translating Database Content
646646
----------------------------
647647

648648
The translation of database content should be handled by Doctrine through
649-
the `Translatable Extension`_. For more information, see the documentation
650-
for that library.
649+
the `Translatable Extension`_ or the `Translatable Bahavior`_ (PHP 5.4+).
650+
For more information, see the documentation for thes libraries.
651651

652652
Summary
653653
-------
@@ -672,3 +672,4 @@ steps:
672672
.. _`ISO 3166-1 alpha-2`: http://en.wikipedia.org/wiki/ISO_3166-1#Current_codes
673673
.. _`ISO 639-1`: http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes
674674
.. _`Translatable Extension`: https://github.com./l3pp4rd/DoctrineExtensions
675+
.. _`Translatable Bahavior`: https://github.com./KnpLabs/DoctrineBehaviors

book/validation.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -985,9 +985,9 @@ entity and a new constraint group called ``Premium``:
985985
Acme\DemoBundle\Entity\User:
986986
properties:
987987
name:
988-
- NotBlank
988+
- NotBlank: ~
989989
creditCard:
990-
- CardScheme
990+
- CardScheme:
991991
schemes: [VISA]
992992
groups: [Premium]
993993

components/console/helpers/dialoghelper.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ from the command line, you need to overwrite the HelperSet used by the command::
277277
return $stream;
278278
}
279279

280-
By setting the inputStream of the ``DialogHelper``, you imitate what the
280+
By setting the input stream of the ``DialogHelper``, you imitate what the
281281
console would do internally with all user input through the cli. This way
282282
you can test any user interaction (even complex ones) by passing an appropriate
283283
input stream.

components/console/helpers/tablehelper.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ When building a console application it may be useful to display tabular data:
1111

1212
.. image:: /images/components/console/table.png
1313

14-
To display table, use the :class:`Symfony\\Component\\Console\\Helper\\TableHelper`,
14+
To display a table, use the :class:`Symfony\\Component\\Console\\Helper\\TableHelper`,
1515
set headers, rows and render::
1616

1717
$table = $app->getHelperSet()->get('table');

components/console/introduction.rst

+6-6
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,8 @@ verbosity levels::
225225
}
226226

227227
When the quiet level is used, all output is suppressed as the default
228-
:method:`Symfony\Component\Console\Output::write <Symfony\\Component\\Console\\Output\\Output::write>`
229-
method returns without actually printing.
228+
:method:`Symfony\\Component\\Console\\Output\\Output::write` method returns
229+
without actually printing.
230230

231231
.. tip::
232232

@@ -321,13 +321,13 @@ Unlike arguments, options are not ordered (meaning you can specify them in any
321321
order) and are specified with two dashes (e.g. ``--yell`` - you can also
322322
declare a one-letter shortcut that you can call with a single dash like
323323
``-y``). Options are *always* optional, and can be setup to accept a value
324-
(e.g. ``dir=src``) or simply as a boolean flag without a value (e.g.
325-
``yell``).
324+
(e.g. ``--dir=src``) or simply as a boolean flag without a value (e.g.
325+
``--yell``).
326326

327327
.. tip::
328328

329329
It is also possible to make an option *optionally* accept a value (so that
330-
``--yell`` or ``yell=loud`` work). Options can also be configured to
330+
``--yell`` or ``--yell=loud`` work). Options can also be configured to
331331
accept an array of values.
332332

333333
For example, add a new option to the command that can be used to specify
@@ -379,7 +379,7 @@ Option Value
379379
InputOption::VALUE_IS_ARRAY This option accepts multiple values (e.g. ``--dir=/foo --dir=/bar``)
380380
InputOption::VALUE_NONE Do not accept input for this option (e.g. ``--yell``)
381381
InputOption::VALUE_REQUIRED This value is required (e.g. ``--iterations=5``), the option itself is still optional
382-
InputOption::VALUE_OPTIONAL This option may or may not have a value (e.g. ``yell`` or ``yell=loud``)
382+
InputOption::VALUE_OPTIONAL This option may or may not have a value (e.g. ``--yell`` or ``--yell=loud``)
383383
=========================== =====================================================================================
384384

385385
You can combine ``VALUE_IS_ARRAY`` with ``VALUE_REQUIRED`` or ``VALUE_OPTIONAL`` like this:

components/dependency_injection/advanced.rst

+13-1
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,18 @@ service by asking for the ``bar`` service like this::
142142

143143
$container->get('bar'); // Would return the foo service
144144

145+
.. tip::
146+
147+
In YAML, you can also use a shortcut to alias a service:
148+
149+
.. code-block:: yaml
150+
151+
services:
152+
foo:
153+
class: Example\Foo
154+
bar: "@foo"
155+
156+
145157
Requiring files
146158
---------------
147159

@@ -169,5 +181,5 @@ the service itself gets loaded. To do so, you can use the ``file`` directive.
169181
$definition->setFile('%kernel.root_dir%/src/path/to/file/foo.php');
170182
$container->setDefinition('foo', $definition);
171183
172-
Notice that Symfony will internally call the PHP function require_once
184+
Notice that Symfony will internally call the PHP statement ``require_once``,
173185
which means that your file will be included only once per request.

components/dependency_injection/definitions.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ Add a method call with::
104104

105105
$definition->addMethodCall($method, $arguments);
106106

107-
Where ``$method`` is the method name and $arguments is an array of the arguments
107+
Where ``$method`` is the method name and ``$arguments`` is an array of the arguments
108108
to call the method with. The arguments can be strings, arrays, parameters or
109109
service ids as with the constructor arguments.
110110

components/dependency_injection/introduction.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ The DependencyInjection Component
99
the way objects are constructed in your application.
1010

1111
For an introduction to Dependency Injection and service containers see
12-
:doc:`/book/service_container`
12+
:doc:`/book/service_container`.
1313

1414
Installation
1515
------------
@@ -181,7 +181,7 @@ Setting Up the Container with Configuration Files
181181
As well as setting up the services using PHP as above you can also use
182182
configuration files. This allows you to use XML or YAML to write the definitions
183183
for the services rather than using PHP to define the services as in the above
184-
examples. In anything but the smallest applications it make sense to organize
184+
examples. In anything but the smallest applications it makes sense to organize
185185
the service definitions by moving them into one or more configuration files.
186186
To do this you also need to install
187187
:doc:`the Config component </components/config/introduction>`.

components/dependency_injection/parentservices.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ The service config for these classes would look something like this:
6868
- [setEmailFormatter, ["@my_email_formatter"]]
6969
7070
greeting_card_manager:
71-
class: "%greeting_card_manager.class%"
71+
class: "%greeting_card_manager.class%"
7272
calls:
7373
- [setMailer, ["@my_mailer"]]
7474
- [setEmailFormatter, ["@my_email_formatter"]]

components/dependency_injection/tags.rst

+12
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,18 @@ To answer this, change the service declaration:
235235
<tag name="acme_mailer.transport" alias="bar" />
236236
</service>
237237
238+
.. code-block:: php
239+
240+
use Symfony\Component\DependencyInjection\Definition;
241+
242+
$definitionSmtp = new Definition('\Swift_SmtpTransport', array('%mailer_host%'));
243+
$definitionSmtp->addTag('acme_mailer.transport', array('alias' => 'foo'));
244+
$container->setDefinition('acme_mailer.transport.smtp', $definitionSmtp);
245+
246+
$definitionSendmail = new Definition('\Swift_SendmailTransport');
247+
$definitionSendmail->addTag('acme_mailer.transport', array('alias' => 'bar'));
248+
$container->setDefinition('acme_mailer.transport.sendmail', $definitionSendmail);
249+
238250
Notice that you've added a generic ``alias`` key to the tag. To actually
239251
use this, update the compiler::
240252

components/http_foundation/introduction.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ If you need to get full access to parsed data from ``Accept``, ``Accept-Language
264264
$quality = $item->getQuality();
265265
}
266266

267-
// accepts items are sorted by descending quality
267+
// Accept header items are sorted by descending quality
268268
$accepts = AcceptHeader::fromString($request->headers->get('Accept'))
269269
->all();
270270

@@ -423,7 +423,7 @@ method::
423423
$response->send();
424424
}
425425

426-
If the Response is not modified, it sets the status code to 304 and remove the
426+
If the Response is not modified, it sets the status code to 304 and removes the
427427
actual response content.
428428

429429
Redirecting the User

components/property_access/introduction.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ You can also mix objects and arrays::
322322

323323
public function setChildren($children)
324324
{
325-
return $this->children;
325+
$this->children = $children;
326326
}
327327

328328
public function getChildren()

components/routing/introduction.rst

+5-5
Original file line numberDiff line numberDiff line change
@@ -73,17 +73,17 @@ Defining routes
7373
A full route definition can contain up to seven parts:
7474

7575
1. The URL path route. This is matched against the URL passed to the `RequestContext`,
76-
and can contain named wildcard placeholders (e.g. ``{placeholders}``)
77-
to match dynamic parts in the URL.
76+
and can contain named wildcard placeholders (e.g. ``{placeholders}``)
77+
to match dynamic parts in the URL.
7878

7979
2. An array of default values. This contains an array of arbitrary values
80-
that will be returned when the request matches the route.
80+
that will be returned when the request matches the route.
8181

8282
3. An array of requirements. These define constraints for the values of the
83-
placeholders as regular expressions.
83+
placeholders as regular expressions.
8484

8585
4. An array of options. These contain internal settings for the route and
86-
are the least commonly needed.
86+
are the least commonly needed.
8787

8888
5. A host. This is matched against the host of the request. See
8989
:doc:`/components/routing/hostname_pattern` for more details.

components/translation/usage.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ The second step is done by creating message catalogs that define the translation
9595
for any number of different locales.
9696

9797
Creating Translations
98-
=====================
98+
---------------------
9999

100100
The act of creating translation files is an important part of "localization"
101101
(often abbreviated `L10n`_). Translation files consist of a series of

contributing/code/bc.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ Symfony's classes:
238238
Type of Change Regular API
239239
================================================== ============== ==============
240240
Remove entirely No No
241-
Make final Yes [2]_ No
241+
Make final No No
242242
Make abstract No No
243243
Change name or namespace No No
244244
Change parent class Yes [7]_ Yes [7]_

cookbook/bundles/inheritance.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ things like controllers, templates, and other files in a bundle's
1212

1313
For example, suppose that you're installing the `FOSUserBundle`_, but you
1414
want to override its base ``layout.html.twig`` template, as well as one of
15-
its controllers. Suppose also that you have your own ``AcmeUserBundle``
15+
its controllers. Suppose also that you have your own AcmeUserBundle
1616
where you want the overridden files to live. Start by registering the FOSUserBundle
1717
as the "parent" of your bundle::
1818

0 commit comments

Comments
 (0)