Skip to content

Commit ba413f4

Browse files
committed
Merge branch '2.3'
Conflicts: reference/constraints/UniqueEntity.rst
2 parents 941a5cc + d11327b commit ba413f4

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

+191
-158
lines changed

book/forms.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,22 @@ corresponding errors printed out with the form.
420420
but are being prevented by your browser from, for example, submitting
421421
blank fields.
422422

423+
.. configuration-block::
424+
425+
.. code-block:: html+jinja
426+
427+
{# src/Acme/DemoBundle/Resources/views/Default/new.html.twig #}
428+
429+
{{ form(form, {'attr': {'novalidate': 'novalidate'}}) }}
430+
431+
.. code-block:: html+php
432+
433+
<!-- src/Acme/DemoBundle/Resources/views/Default/new.html.php -->
434+
435+
<?php echo $view['form']->form($form, array(
436+
'attr' => array('novalidate' => 'novalidate'),
437+
)) ?>
438+
423439
Validation is a very powerful feature of Symfony2 and has its own
424440
:doc:`dedicated chapter </book/validation>`.
425441

book/http_fundamentals.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ So then, what *is* the Symfony2 *Framework*? The *Symfony2 Framework* is
555555
a PHP library that accomplishes two distinct tasks:
556556

557557
#. Provides a selection of components (i.e. the Symfony2 Components) and
558-
third-party libraries (e.g. `Swiftmailer`_ for sending emails);
558+
third-party libraries (e.g. `Swift Mailer`_ for sending emails);
559559

560560
#. Provides sensible configuration and a "glue" library that ties all of these
561561
pieces together.
@@ -581,4 +581,4 @@ sensible defaults. For more advanced users, the sky is the limit.
581581
.. _`Validator`: https://github.com/symfony/Validator
582582
.. _`Security`: https://github.com/symfony/Security
583583
.. _`Translation`: https://github.com/symfony/Translation
584-
.. _`Swiftmailer`: http://swiftmailer.org/
584+
.. _`Swift Mailer`: http://swiftmailer.org/

book/security.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -781,15 +781,15 @@ Take the following ``access_control`` entries as an example:
781781
# ...
782782
access_control:
783783
- { path: ^/admin, roles: ROLE_USER_IP, ip: 127.0.0.1 }
784-
- { path: ^/admin, roles: ROLE_USER_HOST, host: symfony.com }
784+
- { path: ^/admin, roles: ROLE_USER_HOST, host: symfony\.com$ }
785785
- { path: ^/admin, roles: ROLE_USER_METHOD, methods: [POST, PUT] }
786786
- { path: ^/admin, roles: ROLE_USER }
787787
788788
.. code-block:: xml
789789
790790
<access-control>
791791
<rule path="^/admin" role="ROLE_USER_IP" ip="127.0.0.1" />
792-
<rule path="^/admin" role="ROLE_USER_HOST" host="symfony.com" />
792+
<rule path="^/admin" role="ROLE_USER_HOST" host="symfony\.com$" />
793793
<rule path="^/admin" role="ROLE_USER_METHOD" method="POST, PUT" />
794794
<rule path="^/admin" role="ROLE_USER" />
795795
</access-control>
@@ -805,7 +805,7 @@ Take the following ``access_control`` entries as an example:
805805
array(
806806
'path' => '^/admin',
807807
'role' => 'ROLE_USER_HOST',
808-
'host' => 'symfony.com',
808+
'host' => 'symfony\.com$',
809809
),
810810
array(
811811
'path' => '^/admin',

book/testing.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -703,7 +703,7 @@ The Client used by functional tests creates a Kernel that runs in a special
703703
in the ``test`` environment, you can tweak any of your application's settings
704704
specifically for testing.
705705

706-
For example, by default, the swiftmailer is configured to *not* actually
706+
For example, by default, the Swift Mailer is configured to *not* actually
707707
deliver emails in the ``test`` environment. You can see this under the ``swiftmailer``
708708
configuration option:
709709

components/dependency_injection/compilation.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ It is compiled by running::
1313

1414
$container->compile();
1515

16-
The compile method uses *Compiler Passes* for the compilation. The *Dependency Injection*
16+
The compile method uses *Compiler Passes* for the compilation. The Dependency Injection
1717
component comes with several passes which are automatically registered for
1818
compilation. For example the :class:`Symfony\\Component\\DependencyInjection\\Compiler\\CheckDefinitionValidityPass`
1919
checks for various potential issues with the definitions that have been set
@@ -40,7 +40,7 @@ and can be registered with the container with::
4040

4141
$container->registerExtension($extension);
4242

43-
The main work of the extension is done in the ``load`` method. In the load method
43+
The main work of the extension is done in the ``load`` method. In the ``load`` method
4444
you can load configuration from one or more configuration files as well as
4545
manipulate the container definitions using the methods shown in :doc:`/components/dependency_injection/definitions`.
4646

components/dependency_injection/definitions.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ You can add a new argument to the end of the arguments array using::
7373
$definition->addArgument($argument);
7474

7575
The argument can be a string, an array, a service parameter by using ``%parameter_name%``
76-
or a service id by using ::
76+
or a service id by using::
7777

7878
use Symfony\Component\DependencyInjection\Reference;
7979

@@ -122,6 +122,6 @@ You can also replace any existing method calls with an array of new ones with::
122122
.. note::
123123

124124
The methods here that change service definitions can only be used before
125-
the container is compiled, once the container is compiled you cannot
125+
the container is compiled. Once the container is compiled you cannot
126126
manipulate service definitions further. To learn more about compiling
127127
the container see :doc:`/components/dependency_injection/compilation`.

components/dependency_injection/factories.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ For this situation, you can use a factory to create the object and tell the
1212
service container to call a method on the factory rather than directly instantiating
1313
the class.
1414

15-
Suppose you have a factory that configures and returns a new NewsletterManager
15+
Suppose you have a factory that configures and returns a new ``NewsletterManager``
1616
object::
1717

1818
class NewsletterFactory

components/dependency_injection/parameters.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ One use for this is to inject the values into your services. This allows
6060
you to configure different versions of services between applications or multiple
6161
services based on the same class but configured differently within a single
6262
application. You could inject the choice of mail transport into the ``Mailer``
63-
class directly but by making it a parameter. This makes it easier to change
63+
class directly. But declaring it as a parameter makes it easier to change
6464
rather than being tied up and hidden with the service definition:
6565

6666
.. configuration-block::
@@ -343,7 +343,7 @@ Start the string with ``@`` or ``@?`` to reference a service in Yaml.
343343
converted into the string ``"@mailer"`` instead of referencing the
344344
``mailer`` service.
345345

346-
Xml
346+
XML
347347
~~~
348348

349349
In XML, use the ``service`` type. The behavior if the service does not exist
@@ -352,7 +352,7 @@ is thrown. Valid values for ``on-invalid`` are ``null`` (uses ``null`` in place
352352
of the missing service) or ``ignored`` (very similar, except if used on a
353353
method call, the method call is removed).
354354

355-
Php
355+
PHP
356356
~~~
357357

358358
In PHP, you can use the

components/dependency_injection/tags.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ To begin with, define the ``TransportChain`` class::
2727
$this->transports = array();
2828
}
2929

30-
public function addTransport(\Swift_Transport $transport)
30+
public function addTransport(\Swift_Transport $transport)
3131
{
3232
$this->transports[] = $transport;
3333
}
@@ -176,7 +176,7 @@ Adding additional attributes on Tags
176176
------------------------------------
177177

178178
Sometimes you need additional information about each service that's tagged with your tag.
179-
For example, you might want to add an alias to each TransportChain.
179+
For example, you might want to add an alias to each member of the transport chain.
180180

181181
To begin with, change the ``TransportChain`` class::
182182

components/dependency_injection/workflow.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ Compiler passes to allow Interaction between Bundles
6464
:ref:`Compiler passes <components-dependency-injection-compiler-passes>` are
6565
used to allow interaction between different bundles as they cannot affect
6666
each other's configuration in the extension classes. One of the main uses is
67-
to process tagged services, allowing bundles to register services to picked
67+
to process tagged services, allowing bundles to register services to be picked
6868
up by other bundles, such as Monolog loggers, Twig extensions and Data Collectors
6969
for the Web Profiler. Compiler passes are usually placed in the bundle's
7070
``DependencyInjection/Compiler`` directory.

components/event_dispatcher/introduction.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,7 @@ Or::
558558

559559
Or::
560560

561-
$response = $dispatcher->dispatch('bar.event', new BarEvent())->getBar();
561+
$bar = $dispatcher->dispatch('bar.event', new BarEvent())->getBar();
562562

563563
and so on...
564564

components/form/introduction.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -334,12 +334,12 @@ and then access it whenever you need to build a form.
334334

335335
.. note::
336336

337-
In this document, the form factory is always a locally variable called
337+
In this document, the form factory is always a local variable called
338338
``$formFactory``. The point here is that you will probably need to create
339339
this object in some more "global" way so you can access it from anywhere.
340340

341341
Exactly how you gain access to your one form factory is up to you. If you're
342-
using a :term`Service Container`, then you should add the form factory to
342+
using a :term:`Service Container`, then you should add the form factory to
343343
your container and grab it out whenever you need to. If your application
344344
uses global or static variables (not usually a good idea), then you can store
345345
the object on some static class or do something similar.
@@ -414,7 +414,7 @@ it and :ref:`process the form submission <component-form-intro-handling-submissi
414414
Setting Default Values
415415
~~~~~~~~~~~~~~~~~~~~~~
416416

417-
If you need you form to load with some default values (or you're building
417+
If you need your form to load with some default values (or you're building
418418
an "edit" form), simply pass in the default data when creating your form
419419
builder:
420420

components/http_foundation/introduction.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ can be accessed via several public properties:
6161

6262
* ``cookies``: equivalent of ``$_COOKIE``;
6363

64-
* ``attributes``: no equivalent - used by your app to store other data (see :ref:`below <component-foundation-attributes>`)
64+
* ``attributes``: no equivalent - used by your app to store other data (see :ref:`below <component-foundation-attributes>`);
6565

6666
* ``files``: equivalent of ``$_FILES``;
6767

@@ -109,7 +109,7 @@ methods to retrieve and update its data:
109109
parameter by name;
110110

111111
* :method:`Symfony\\Component\\HttpFoundation\\ParameterBag::has`: Returns
112-
true if the parameter is defined;
112+
``true`` if the parameter is defined;
113113

114114
* :method:`Symfony\\Component\\HttpFoundation\\ParameterBag::remove`: Removes
115115
a parameter.
@@ -351,7 +351,7 @@ Sending the response to the client is then as simple as calling
351351
Setting Cookies
352352
~~~~~~~~~~~~~~~
353353

354-
The response cookies can be manipulated though the ``headers`` public
354+
The response cookies can be manipulated through the ``headers`` public
355355
attribute::
356356

357357
use Symfony\Component\HttpFoundation\Cookie;
@@ -484,7 +484,7 @@ whether or not the ``X-Sendfile-Type`` header should be trusted and call
484484
:method:`Symfony\\Component\\HttpFoundation\\BinaryFileResponse::trustXSendfileTypeHeader`
485485
if it should::
486486

487-
$response::trustXSendfileTypeHeader();
487+
BinaryFileResponse::trustXSendfileTypeHeader();
488488

489489
You can still set the ``Content-Type`` of the sent file, or change its ``Content-Disposition``::
490490

components/http_foundation/session_configuration.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ be securely controlled from the server side.
119119

120120
The ``cookie_lifetime`` setting is the number of seconds the cookie should live
121121
for, it is not a Unix timestamp. The resulting session cookie will be stamped
122-
with an expiry time of ``time()``+``cookie_lifetime`` where the time is taken
122+
with an expiry time of ``time()`` + ``cookie_lifetime`` where the time is taken
123123
from the server.
124124

125125
Configuring Garbage Collection
@@ -132,7 +132,7 @@ of 5%. Similarly, ``3/4`` would mean a 3 in 4 chance of being called, i.e. 75%.
132132

133133
If the garbage collection handler is invoked, PHP will pass the value stored in
134134
the ``php.ini`` directive ``session.gc_maxlifetime``. The meaning in this context is
135-
that any stored session that was saved more than ``maxlifetime`` ago should be
135+
that any stored session that was saved more than ``gc_maxlifetime`` ago should be
136136
deleted. This allows one to expire records based on idle time.
137137

138138
You can configure these settings by passing ``gc_probability``, ``gc_divisor``
@@ -173,8 +173,8 @@ example, it is common for banking applications to log the user out after just
173173
5 to 10 minutes of inactivity. Setting the cookie lifetime here is not
174174
appropriate because that can be manipulated by the client, so we must do the expiry
175175
on the server side. The easiest way is to implement this via garbage collection
176-
which runs reasonably frequently. The cookie ``lifetime`` would be set to a
177-
relatively high value, and the garbage collection ``maxlifetime`` would be set
176+
which runs reasonably frequently. The ``cookie_lifetime`` would be set to a
177+
relatively high value, and the garbage collection ``gc_maxlifetime`` would be set
178178
to destroy sessions at whatever the desired idle period is.
179179

180180
The other option is to specifically checking if a session has expired after the
@@ -258,7 +258,7 @@ without knowledge of the specific save handler.
258258

259259
.. note::
260260

261-
Before PHP 5.4, you can only proxy user-land save handlers but not
261+
Before PHP 5.4, you can only proxy user-land save handlers but not
262262
native PHP save handlers.
263263

264264
.. _`php.net/session.customhandler`: http://php.net/session.customhandler

components/http_foundation/session_testing.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ starting one allowing you to test your code without complications. You may also
1818
run multiple instances in the same PHP process.
1919

2020
The mock storage drivers do not read or write the system globals
21-
`session_id()` or `session_name()`. Methods are provided to simulate this if
21+
``session_id()`` or ``session_name()``. Methods are provided to simulate this if
2222
required:
2323

2424
* :method:`Symfony\\Component\\HttpFoundation\\Session\\SessionStorageInterface::getId`: Gets the

components/http_foundation/sessions.rst

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -62,24 +62,24 @@ as follows divided into a couple of groups.
6262
Session workflow
6363

6464
* :method:`Symfony\\Component\\HttpFoundation\\Session\\Session::start`:
65-
Starts the session - do not use ``session_start()``.
65+
Starts the session - do not use ``session_start()``;
6666

6767
* :method:`Symfony\\Component\\HttpFoundation\\Session\\Session::migrate`:
6868
Regenerates the session ID - do not use ``session_regenerate_id()``.
6969
This method can optionally change the lifetime of the new cookie that will
70-
be emitted by calling this method.
70+
be emitted by calling this method;
7171

7272
* :method:`Symfony\\Component\\HttpFoundation\\Session\\Session::invalidate`:
73-
Clears all session data and regenerates session ID. Do not use ``session_destroy()``.
73+
Clears all session data and regenerates session ID. Do not use ``session_destroy()``;
7474

7575
* :method:`Symfony\\Component\\HttpFoundation\\Session\\Session::getId`: Gets the
76-
session ID. Do not use ``session_id()``.
76+
session ID. Do not use ``session_id()``;
7777

7878
* :method:`Symfony\\Component\\HttpFoundation\\Session\\Session::setId`: Sets the
79-
session ID. Do not use ``session_id()``.
79+
session ID. Do not use ``session_id()``;
8080

8181
* :method:`Symfony\\Component\\HttpFoundation\\Session\\Session::getName`: Gets the
82-
session name. Do not use ``session_name()``.
82+
session name. Do not use ``session_name()``;
8383

8484
* :method:`Symfony\\Component\\HttpFoundation\\Session\\Session::setName`: Sets the
8585
session name. Do not use ``session_name()``.
@@ -99,23 +99,23 @@ Session attributes
9999
Returns true if the attribute exists;
100100

101101
* :method:`Symfony\\Component\\HttpFoundation\\Session\\Session::replace`:
102-
Sets multiple attributes at once: takes a keyed array and sets each key => value pair.
102+
Sets multiple attributes at once: takes a keyed array and sets each key => value pair;
103103

104104
* :method:`Symfony\\Component\\HttpFoundation\\Session\\Session::remove`:
105105
Deletes an attribute by key;
106106

107107
* :method:`Symfony\\Component\\HttpFoundation\\Session\\Session::clear`:
108-
Clear all attributes;
108+
Clear all attributes.
109109

110110
The attributes are stored internally in an "Bag", a PHP object that acts like
111111
an array. A few methods exist for "Bag" management:
112112

113113
* :method:`Symfony\\Component\\HttpFoundation\\Session\\Session::registerBag`:
114-
Registers a :class:`Symfony\\Component\\HttpFoundation\\Session\\SessionBagInterface`
114+
Registers a :class:`Symfony\\Component\\HttpFoundation\\Session\\SessionBagInterface`;
115115

116116
* :method:`Symfony\\Component\\HttpFoundation\\Session\\Session::getBag`:
117117
Gets a :class:`Symfony\\Component\\HttpFoundation\\Session\\SessionBagInterface` by
118-
bag name.
118+
bag name;
119119

120120
* :method:`Symfony\\Component\\HttpFoundation\\Session\\Session::getFlashBag`:
121121
Gets the :class:`Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBagInterface`.
@@ -238,7 +238,7 @@ would be displayed immediately on the subsequent page load for that session.
238238
This is however just one application for flash messages.
239239

240240
* :class:`Symfony\\Component\\HttpFoundation\\Session\\Flash\\AutoExpireFlashBag`
241-
This implementation messages set in one page-load will
241+
In this implementation, messages set in one page-load will
242242
be available for display only on the next page load. These messages will auto
243243
expire regardless of if they are retrieved or not.
244244

@@ -302,7 +302,7 @@ Examples of setting multiple flashes::
302302
$session->getFlashBag()->add('error', 'Failed to update name');
303303
$session->getFlashBag()->add('error', 'Another error');
304304

305-
Displaying the flash messages might look like this:
305+
Displaying the flash messages might look as follows.
306306

307307
Simple, display one type of message::
308308

components/http_kernel/introduction.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ listeners to the events discussed below::
104104
// by dispatching events, calling a controller, and returning the response
105105
$response = $kernel->handle($request);
106106

107-
// echo the content and send the headers
107+
// send the headers and echo the content
108108
$response->send();
109109

110110
// triggers the kernel.terminate event
@@ -461,7 +461,7 @@ because it occurs *after* the ``HttpKernel::handle`` method, and after the
461461
response is sent to the user. Recall from above, then the code that uses
462462
the kernel, ends like this::
463463

464-
// echo the content and send the headers
464+
// send the headers and echo the content
465465
$response->send();
466466

467467
// triggers the kernel.terminate event

components/routing/introduction.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ does *not* match, because "foo" fails the month wildcard.
127127

128128
.. tip::
129129

130-
If you want to match all urls which start with a certain path and end in an
130+
If you want to match all URLs which start with a certain path and end in an
131131
arbitrary suffix you can use the following route definition::
132132

133133
$route = new Route(

0 commit comments

Comments
 (0)