Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 8e08e35

Browse files
committedMar 5, 2016
Merge branch '2.7' into 2.8
Conflicts: components/form/introduction.rst reference/forms/types/choice.rst
2 parents 0f32eef + 29567b1 commit 8e08e35

32 files changed

+932
-675
lines changed
 

‎book/forms.rst

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -273,21 +273,15 @@ possible paths:
273273
#. When initially loading the page in a browser, the form is simply created and
274274
rendered. :method:`Symfony\\Component\\Form\\FormInterface::handleRequest`
275275
recognizes that the form was not submitted and does nothing.
276-
:method:`Symfony\\Component\\Form\\FormInterface::isValid` returns ``false``
276+
:method:`Symfony\\Component\\Form\\FormInterface::isSubmitted` returns ``false``
277277
if the form was not submitted.
278278

279279
#. When the user submits the form, :method:`Symfony\\Component\\Form\\FormInterface::handleRequest`
280280
recognizes this and immediately writes the submitted data back into the
281281
``task`` and ``dueDate`` properties of the ``$task`` object. Then this object
282282
is validated. If it is invalid (validation is covered in the next section),
283-
:method:`Symfony\\Component\\Form\\FormInterface::isValid` returns ``false``
284-
again, so the form is rendered together with all validation errors;
285-
286-
.. note::
287-
288-
You can use the method :method:`Symfony\\Component\\Form\\FormInterface::isSubmitted`
289-
to check whether a form was submitted, regardless of whether or not the
290-
submitted data is actually valid.
283+
:method:`Symfony\\Component\\Form\\FormInterface::isValid` returns
284+
``false``, so the form is rendered together with all validation errors;
291285

292286
#. When the user submits the form with valid data, the submitted data is again
293287
written into the form, but this time :method:`Symfony\\Component\\Form\\FormInterface::isValid`

‎book/routing.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1554,7 +1554,7 @@ Generating Absolute URLs
15541554
~~~~~~~~~~~~~~~~~~~~~~~~
15551555

15561556
By default, the router will generate relative URLs (e.g. ``/blog``). From
1557-
a controller, simply pass ``true`` to the third argument of the ``generateUrl()``
1557+
a controller, simply pass ``UrlGeneratorInterface::ABSOLUTE_URL`` to the third argument of the ``generateUrl()``
15581558
method::
15591559

15601560
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;

‎book/templating.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1071,7 +1071,7 @@ being used and generating the correct paths accordingly.
10711071
Additionally, if you use the ``asset`` function, Symfony can automatically
10721072
append a query string to your asset, in order to guarantee that updated static
10731073
assets won't be cached when deployed. For example, ``/images/logo.png`` might
1074-
look like ``/images/logo.png?v2``. For more information, see the :ref:`ref-framework-assets-version`
1074+
look like ``/images/logo.png?v2``. For more information, see the :ref:`reference-framework-assets-version`
10751075
configuration option.
10761076

10771077
.. _`book-templating-version-by-asset`:
@@ -1095,7 +1095,7 @@ if you are using Twig (or the fourth argument if you are using PHP) to the desir
10951095
) ?>" alt="Symfony!" />
10961096

10971097
If you don't give a version or pass ``null``, the default package version
1098-
(from :ref:`ref-framework-assets-version`) will be used. If you pass ``false``,
1098+
(from :ref:`reference-framework-assets-version`) will be used. If you pass ``false``,
10991099
versioned URL will be deactivated for this asset.
11001100

11011101
If you need absolute URLs for assets, you can use the ``absolute_url`` function

‎changelog.rst

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,77 @@ documentation.
1313
Do you also want to participate in the Symfony Documentation? Take a look
1414
at the ":doc:`/contributing/documentation/overview`" article.
1515

16+
February, 2016
17+
--------------
18+
19+
New Documentation
20+
~~~~~~~~~~~~~~~~~
21+
22+
* `#6172 <https://github.com/symfony/symfony-docs/pull/6172>`_ move assets options from templating to assets section and add base_path documentation (snoek09)
23+
* `#6021 <https://github.com/symfony/symfony-docs/pull/6021>`_ mention routing from the database (dbu)
24+
* `#6233 <https://github.com/symfony/symfony-docs/pull/6233>`_ Document translation_domain for choice fields (merorafael, WouterJ)
25+
* `#5655 <https://github.com/symfony/symfony-docs/pull/5655>`_ Added doc about Homestead's Symfony integration (WouterJ)
26+
* `#6072 <https://github.com/symfony/symfony-docs/pull/6072>`_ Add browserkit component documentation (yamiko, yamiko-ninja, robert Parker, javiereguiluz)
27+
* `#6243 <https://github.com/symfony/symfony-docs/pull/6243>`_ Add missing getBoolean() method (bocharsky-bw)
28+
* `#6231 <https://github.com/symfony/symfony-docs/pull/6231>`_ Use hash_equals instead of StringUtils::equals (WouterJ)
29+
* `#5724 <https://github.com/symfony/symfony-docs/pull/5724>`_ Describe configuration behaviour with multiple mailers (xelan)
30+
* `#6077 <https://github.com/symfony/symfony-docs/pull/6077>`_ fixes #5971 (vincentaubert)
31+
* `#6156 <https://github.com/symfony/symfony-docs/pull/6156>`_ [reference] [form] [options] fix #6153 (HeahDude)
32+
* `#6104 <https://github.com/symfony/symfony-docs/pull/6104>`_ Fix #6103 (zsturgess)
33+
* `#5856 <https://github.com/symfony/symfony-docs/pull/5856>`_ Reworded the "How to use Gmail" cookbook article (javiereguiluz)
34+
* `#6230 <https://github.com/symfony/symfony-docs/pull/6230>`_ Add annotation to glossary (rebased) (DerStoffel)
35+
* `#5642 <https://github.com/symfony/symfony-docs/pull/5642>`_ Documented label_format option (WouterJ)
36+
37+
Fixed Documentation
38+
~~~~~~~~~~~~~~~~~~~
39+
40+
* `#5995 <https://github.com/symfony/symfony-docs/pull/5995>`_ Update dev_environment.rst (gonzalovilaseca)
41+
* `#6240 <https://github.com/symfony/symfony-docs/pull/6240>`_ [#6224] some tweaks (xabbuh)
42+
* `#5513 <https://github.com/symfony/symfony-docs/pull/5513>`_ [load_balancer_reverse_proxy ] Always use 127.0.0.1 as a trusted proxy (ruudk)
43+
* `#6124 <https://github.com/symfony/symfony-docs/pull/6124>`_ [cookbook] Add annotations block and fix regex (peterkokot)
44+
45+
Minor Documentation Changes
46+
~~~~~~~~~~~~~~~~~~~~~~~~~~~
47+
48+
* `#6308 <https://github.com/symfony/symfony-docs/pull/6308>`_ fix literal syntax (xabbuh)
49+
* `#6251 <https://github.com/symfony/symfony-docs/pull/6251>`_ To use annotations, files must be removed (pbowyer)
50+
* `#6288 <https://github.com/symfony/symfony-docs/pull/6288>`_ Update factories.rst (velikanov)
51+
* `#6278 <https://github.com/symfony/symfony-docs/pull/6278>`_ [HttpFoundation] Fix typo for ParameterBag getters (rendler-denis)
52+
* `#6280 <https://github.com/symfony/symfony-docs/pull/6280>`_ Fix syntax of Company class example (cakper)
53+
* `#6284 <https://github.com/symfony/symfony-docs/pull/6284>`_ [Book] [Routing] Fix third param true to UrlGeneratorInterface::ABSOLUTE_URI (eriwin)
54+
* `#6269 <https://github.com/symfony/symfony-docs/pull/6269>`_ [Cookbook][Bundles]fix yaml syntax (mhor)
55+
* `#6255 <https://github.com/symfony/symfony-docs/pull/6255>`_ [Cookbook][Doctrine] some tweaks to the Doctrine registration article (xabbuh)
56+
* `#6229 <https://github.com/symfony/symfony-docs/pull/6229>`_ Rewrite EventDispatcher introduction (WouterJ)
57+
* `#6260 <https://github.com/symfony/symfony-docs/pull/6260>`_ add missing options `choice_value`, `choice_name` and `choice_attr` to `EntityType` (HeahDude)
58+
* `#6262 <https://github.com/symfony/symfony-docs/pull/6262>`_ [Form] reorder options in choice types references (HeahDude)
59+
* `#6256 <https://github.com/symfony/symfony-docs/pull/6256>`_ Fixed code example (twifty)
60+
* `#6250 <https://github.com/symfony/symfony-docs/pull/6250>`_ [Cookbook][Console] remove note about memory spool handling on CLI (xabbuh)
61+
* `#6249 <https://github.com/symfony/symfony-docs/pull/6249>`_ [Cookbook][Serializer] fix wording (xabbuh)
62+
* `#6246 <https://github.com/symfony/symfony-docs/pull/6246>`_ removed duplicate lines (seferov)
63+
* `#6222 <https://github.com/symfony/symfony-docs/pull/6222>`_ Updated "Learn more from the Cookbook" section (sfdumi)
64+
* `#6245 <https://github.com/symfony/symfony-docs/pull/6245>`_ [Cookbook][Console] change API doc class name (xabbuh)
65+
* `#6223 <https://github.com/symfony/symfony-docs/pull/6223>`_ Improveme the apache/mod_php configuration example (gnat42)
66+
* `#6234 <https://github.com/symfony/symfony-docs/pull/6234>`_ File System Security Issue in Custom Auth Article (finished) (mattjanssen, WouterJ)
67+
* `#4773 <https://github.com/symfony/symfony-docs/pull/4773>`_ [Cookbook] Make registration_form follow best practices (xelaris)
68+
* `#5630 <https://github.com/symfony/symfony-docs/pull/5630>`_ Add a caution about logout when using http-basic authenticated firewall (rmed19)
69+
* `#6215 <https://github.com/symfony/symfony-docs/pull/6215>`_ Added a caution about failing cache warmers (javiereguiluz)
70+
* `#6239 <https://github.com/symfony/symfony-docs/pull/6239>`_ Remove app_dev as build-in server is used (rmed19, WouterJ)
71+
* `#6241 <https://github.com/symfony/symfony-docs/pull/6241>`_ [ExpressionLanguage] Add caution about backslash handling (zerustech, WouterJ)
72+
* `#6236 <https://github.com/symfony/symfony-docs/pull/6236>`_ fix some minor typos (xabbuh)
73+
* `#6237 <https://github.com/symfony/symfony-docs/pull/6237>`_ use literals for external class names (xabbuh)
74+
* `#6206 <https://github.com/symfony/symfony-docs/pull/6206>`_ add separate placeholder examples for birthday, datetime and time type (snoek09)
75+
* `#6238 <https://github.com/symfony/symfony-docs/pull/6238>`_ fix directive name (xabbuh)
76+
* `#6224 <https://github.com/symfony/symfony-docs/pull/6224>`_ Note to create a service if you extend ExceptionController (pamuche)
77+
* `#5958 <https://github.com/symfony/symfony-docs/pull/5958>`_ Update security.rst (mpaquet)
78+
* `#6092 <https://github.com/symfony/symfony-docs/pull/6092>`_ Updated information about testing code coverage. (roga)
79+
* `#6051 <https://github.com/symfony/symfony-docs/pull/6051>`_ Mention HautelookAliceBundle in best practices (theofidry, WouterJ)
80+
* `#6220 <https://github.com/symfony/symfony-docs/pull/6220>`_ [book] fixes typo about redirect status codes in the controller chapter. (hhamon)
81+
* `#6227 <https://github.com/symfony/symfony-docs/pull/6227>`_ Update testing.rst (dvapelnik)
82+
* `#6212 <https://github.com/symfony/symfony-docs/pull/6212>`_ Typo in default session save_path (DerekRoth)
83+
* `#6208 <https://github.com/symfony/symfony-docs/pull/6208>`_ Replace references of PSR-0 with PSR-4 (opdavies)
84+
* `#6190 <https://github.com/symfony/symfony-docs/pull/6190>`_ Fix redundant command line sample (sylozof)
85+
86+
1687
January, 2016
1788
-------------
1889

‎components/dependency_injection/factories.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ configure the service container to use the
5252
<factory class="NewsletterManagerFactory" method="createNewsletterManager" />
5353
</service>
5454
</services>
55-
</services>
55+
</container>
5656
5757
.. code-block:: php
5858

‎components/event_dispatcher/introduction.rst

Lines changed: 96 additions & 236 deletions
Large diffs are not rendered by default.

‎components/form/introduction.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ by ``handleRequest()`` to determine whether a form has been submitted):
556556
557557
public function searchAction()
558558
{
559-
$formBuilder = $this->createFormBuilder(FormType::class, null, array(
559+
$formBuilder = $this->createFormBuilder(null, array(
560560
'action' => '/search',
561561
'method' => 'GET',
562562
));

‎components/http_foundation/introduction.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ has some methods to filter the input values:
140140
:method:`Symfony\\Component\\HttpFoundation\\ParameterBag::filter`
141141
Filters the parameter by using the PHP :phpfunction:`filter_var` function.
142142

143-
All getters takes up to three arguments: the first one is the parameter name
143+
All getters take up to three arguments: the first one is the parameter name
144144
and the second one is the default value to return if the parameter does not
145145
exist::
146146

‎components/serializer.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -363,8 +363,8 @@ Given you have the following object::
363363

364364
class Company
365365
{
366-
public name;
367-
public address;
366+
public $name;
367+
public $address;
368368
}
369369

370370
And in the serialized form, all attributes must be prefixed by ``org_`` like

‎cookbook/assetic/asset_management.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ done from the template and is relative to the public document root:
555555
Symfony also contains a method for cache *busting*, where the final URL
556556
generated by Assetic contains a query parameter that can be incremented
557557
via configuration on each deployment. For more information, see the
558-
:ref:`ref-framework-assets-version` configuration option.
558+
:ref:`reference-framework-assets-version` configuration option.
559559

560560
.. _cookbook-assetic-dumping:
561561

‎cookbook/bundles/installation.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,12 +122,12 @@ The output will look like this:
122122
.. code-block:: text
123123
124124
assetic:
125-
debug: %kernel.debug%
125+
debug: '%kernel.debug%'
126126
use_controller:
127-
enabled: %kernel.debug%
127+
enabled: '%kernel.debug%'
128128
profiler: false
129-
read_from: %kernel.root_dir%/../web
130-
write_to: %assetic.read_from%
129+
read_from: '%kernel.root_dir%/../web'
130+
write_to: '%assetic.read_from%'
131131
java: /usr/bin/java
132132
node: /usr/local/bin/node
133133
node_paths: []

‎cookbook/console/logging.rst

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,7 @@ First configure a listener for console exception events in the service container
8686
services:
8787
kernel.listener.command_dispatch:
8888
class: AppBundle\EventListener\ConsoleExceptionListener
89-
arguments:
90-
logger: '@logger'
89+
arguments: ['@logger']
9190
tags:
9291
- { name: kernel.event_listener, event: console.exception }
9392
@@ -184,8 +183,7 @@ First configure a listener for console terminate events in the service container
184183
services:
185184
kernel.listener.command_dispatch:
186185
class: AppBundle\EventListener\ErrorLoggerListener
187-
arguments:
188-
logger: '@logger'
186+
arguments: ['@logger']
189187
tags:
190188
- { name: kernel.event_listener, event: console.terminate }
191189

‎cookbook/deployment/fortrabbit.rst

Lines changed: 285 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,285 @@
1+
.. index::
2+
single: Deployment; Deploying to fortrabbit.com
3+
4+
Deploying to fortrabbit
5+
=======================
6+
7+
This step-by-step cookbook describes how to deploy a Symfony web application to
8+
`fortrabbit`_. You can read more about using Symfony with fortrabbit on the
9+
official fortrabbit `Symfony install guide`_.
10+
11+
Setting up fortrabbit
12+
---------------------
13+
14+
Before getting started, you should have done a few things on the fortrabbit side:
15+
16+
* `Sign up`_;
17+
* Add an SSH key to your Account (to deploy via Git);
18+
* Create an App.
19+
20+
Preparing your Application
21+
--------------------------
22+
23+
You don't need to change any code to deploy a Symfony application to fortrabbit.
24+
But it requires some minor tweaks to its configuration.
25+
26+
Configure Logging
27+
~~~~~~~~~~~~~~~~~
28+
29+
Per default Symfony logs to a file. Modify the ``app/config/config_prod.yml`` file
30+
to redirect it to :phpfunction:`error_log`:
31+
32+
.. configuration-block::
33+
34+
.. code-block:: yaml
35+
36+
# app/config/config_prod.yml
37+
monolog:
38+
# ...
39+
handlers:
40+
nested:
41+
type: error_log
42+
43+
.. code-block:: xml
44+
45+
<!-- app/config/config_prod.xml -->
46+
<?xml version="1.0" encoding="UTF-8" ?>
47+
<container xmlns="http://symfony.com/schema/dic/services"
48+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
49+
xmlns:monolog="http://symfony.com/schema/dic/monolog"
50+
xsi:schemaLocation="http://symfony.com/schema/dic/services
51+
http://symfony.com/schema/dic/services/services-1.0.xsd
52+
http://symfony.com/schema/dic/monolog
53+
http://symfony.com/schema/dic/monolog/monolog-1.0.xsd">
54+
55+
<monolog:config>
56+
<!-- ... -->
57+
<monolog:handler name="nested" type="error_log" />
58+
</monolog:config>
59+
</container>
60+
61+
.. code-block:: php
62+
63+
// app/config/config_prod.php
64+
$container->loadFromExtension('monolog', array(
65+
// ...
66+
'handlers' => array(
67+
'nested' => array(
68+
'type' => 'error_log',
69+
),
70+
),
71+
));
72+
73+
Configuring Database Access & Session Handler
74+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
75+
76+
You can use the fortrabbit App Secrets to attain your database credentials.
77+
Create the file ``app/config/config_prod_secrets.php`` with the following
78+
contents::
79+
80+
// get the path to the secrects.json file
81+
$secrets = getenv("APP_SECRETS")
82+
if (!$secrets) {
83+
return;
84+
}
85+
86+
// read the file and decode json to an array
87+
$secrets = json_decode(file_get_contents($secrets), true);
88+
89+
// set database parameters to the container
90+
if (isset($secrets['MYSQL'])) {
91+
$container->setParameter('database_driver', 'pdo_mysql');
92+
$container->setParameter('database_host', $secrets['MYSQL']['HOST']);
93+
$container->setParameter('database_name', $secrets['MYSQL']['DATABASE']);
94+
$container->setParameter('database_user', $secrets['MYSQL']['USER']);
95+
$container->setParameter('database_password', $secrets['MYSQL']['PASSWORD']);
96+
}
97+
98+
// check if the Memcache component is present
99+
if (isset($secrets['MEMCACHE'])) {
100+
$memcache = $secrets['MEMCACHE'];
101+
$handlers = [];
102+
103+
foreach (range(1, $memcache['COUNT']) as $num) {
104+
$handlers[] = $memcache['HOST'.$num].':'.$memcache['PORT'.$num];
105+
}
106+
107+
// apply ini settings
108+
ini_set('session.save_handler', 'memcached');
109+
ini_set('session.save_path', implode(',', $handlers));
110+
111+
if ("2" === $memcache['COUNT']) {
112+
ini_set('memcached.sess_number_of_replicas', 1);
113+
ini_set('memcached.sess_consistent_hash', 1);
114+
ini_set('memcached.sess_binary', 1);
115+
}
116+
}
117+
118+
Make sure this file is imported into the main config file:
119+
120+
.. configuration-block::
121+
122+
.. code-block:: yaml
123+
124+
# app/config/config_prod.yml
125+
imports:
126+
- { resource: config.yml }
127+
- { resource: config_prod_secrets.php }
128+
129+
# ..
130+
framework:
131+
session:
132+
# set handler_id to null to use default session handler from php.ini (memcached)
133+
handler_id: ~
134+
# ..
135+
136+
.. code-block:: xml
137+
138+
<!-- app/config/config_prod.xml -->
139+
<?xml version="1.0" encoding="UTF-8"?>
140+
<container xmlns="http://symfony.com/schema/dic/services"
141+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
142+
xmlns:framework="http://symfony.com/schema/dic/symfony"
143+
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd
144+
http://symfony.com/schema/dic/symfony http://symfony.com/schema/dic/symfony/symfony-1.0.xsd">
145+
146+
<imports>
147+
<import resource="config.xml" />
148+
<import resource="config_prod_secrets.php" />
149+
</imports>
150+
151+
<!-- .. -->
152+
<framework:config>
153+
<!-- .. -->
154+
<framework:session save_path="null" />
155+
</framework:config>
156+
</container>
157+
158+
.. code-block:: php
159+
160+
// app/config/config_prod.php
161+
$loader->import('config/config.php');
162+
$loader->import('config_prod_secrets.php');
163+
164+
$container->loadFromExtension('framework', array(
165+
'session' => array(
166+
'handler_id' => null,
167+
),
168+
));
169+
170+
// ...
171+
172+
Configuring the Environment in the Dashboard
173+
--------------------------------------------
174+
175+
PHP Settings
176+
~~~~~~~~~~~~
177+
178+
The PHP version and enabled extensions are configuable under the PHP settings
179+
of your App within the fortrabbit Dashboard.
180+
181+
Environment Variables
182+
~~~~~~~~~~~~~~~~~~~~~
183+
184+
Set the ``SYMFONY_ENV`` environment variable to ``prod`` to make sure the right
185+
config files get loaded. ENV vars are configuable in fortrabbit Dashboard as well.
186+
187+
Document Root
188+
~~~~~~~~~~~~~
189+
190+
The document root is configuable for every custom domain you setup for your App.
191+
The default is ``/htdocs``, but for Symfony you probably want to change it to
192+
``/htdocs/web``. You also do so in the fortrabbit Dashboard under ``Domain`` settings.
193+
194+
Deploying to fortrabbit
195+
-----------------------
196+
197+
It is assumed that your codebase is under version-control with Git and dependencies
198+
are managed with Composer (locally).
199+
200+
Every time you push to fortrabbit composer install runs before your code gets
201+
deployed. To finetune the deployment behavior put a `fortrabbit.yml`_. deployment
202+
file (optional) in the project root.
203+
204+
Add fortrabbit as a (additional) Git remote and add your configuration changes:
205+
206+
.. code-block:: bash
207+
208+
$ git remote add fortrabbit git@deploy.eu2.frbit.com:<your-app>.git
209+
$ git add composer.json composer.lock
210+
$ git add app/config/config_prod_secrets.php
211+
212+
Commit and push
213+
214+
.. code-block:: bash
215+
216+
$ git commit -m 'fortrabbit config'
217+
$ git push fortrabbit master -u
218+
219+
.. note::
220+
221+
Replace ``<your-app>`` with the name of your fortrabbit App.
222+
223+
.. code-block:: bash
224+
225+
Commit received, starting build of branch master
226+
227+
––––––––––––––––––––––– ∙ƒ –––––––––––––––––––––––
228+
229+
B U I L D
230+
231+
Checksum:
232+
def1bb29911a62de26b1ddac6ef97fc76a5c647b
233+
234+
Deployment file:
235+
fortrabbit.yml
236+
237+
Pre-script:
238+
not found
239+
0ms
240+
241+
Composer:
242+
- - -
243+
Loading composer repositories with package information
244+
Installing dependencies (including require-dev) from lock file
245+
Nothing to install or update
246+
Generating autoload files
247+
248+
- - -
249+
172ms
250+
251+
Post-script:
252+
not found
253+
0ms
254+
255+
R E L E A S E
256+
257+
Packaging:
258+
930ms
259+
260+
Revision:
261+
1455788127289043421.def1bb29911a62de26b1ddac6ef97fc76a5c647b
262+
263+
Size:
264+
9.7MB
265+
266+
Uploading:
267+
500ms
268+
269+
Build & release done in 1625ms, now queued for final distribution.
270+
271+
272+
.. note::
273+
274+
The first ``git push`` takes much longer as all composer dependencies get
275+
downloaded. All subsequent deploys are done within seconds.
276+
277+
That's it! Your application is being deployed on fortrabbit. More information
278+
about `database migrations and tunneling`_ can be found in the fortrabbit
279+
documentation.
280+
281+
.. _`fortrabbit`: https://www.fortrabbit.com
282+
.. _`Symfony install guide`: https://help.fortrabbit.com/install-symfony
283+
.. _`fortrabbit.yml`: https://help.fortrabbit.com/deployment-file-v2
284+
.. _`database migrations and tunneling`: https://help.fortrabbit.com/install-symfony-2#toc-migrate-amp-other-database-commands
285+
.. _`Sign up`: https://dashboard.fortrabbit.com

‎cookbook/deployment/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ Deployment
88
azure-website
99
heroku
1010
platformsh
11+
fortrabbit

‎cookbook/doctrine/registration_form.rst

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Your ``User`` entity will probably at least have the following fields:
3535
``plainPassword``
3636
This field is *not* persisted: (notice no ``@ORM\Column`` above it). It
3737
temporarily stores the plain password from the registration form. This field
38-
can be validated then used to populate the ``password`` field.
38+
can be validated and is then used to populate the ``password`` field.
3939

4040
With some validation added, your class may look something like this::
4141

@@ -127,17 +127,18 @@ With some validation added, your class may look something like this::
127127

128128
public function getSalt()
129129
{
130-
// The bcrypt algorithm don't require a separate salt.
130+
// The bcrypt algorithm doesn't require a separate salt.
131131
// You *may* need a real salt if you choose a different encoder.
132132
return null;
133133
}
134134

135135
// other methods, including security methods like getRoles()
136136
}
137137

138-
The ``UserInterface`` requires a few other methods and your ``security.yml`` file
139-
needs to be configured properly to work with the ``User`` entity. For a more full
140-
example, see the :ref:`Entity Provider <security-crete-user-entity>` article.
138+
The :class:`Symfony\\Component\\Security\\Core\\User\\UserInterface` requires
139+
a few other methods and your ``security.yml`` file needs to be configured
140+
properly to work with the ``User`` entity. For a more complete example, see
141+
the :ref:`Entity Provider <security-crete-user-entity>` article.
141142

142143
.. _cookbook-registration-password-max:
143144

@@ -190,7 +191,7 @@ Next, create the form for the ``User`` entity::
190191
public function configureOptions(OptionsResolver $resolver)
191192
{
192193
$resolver->setDefaults(array(
193-
'data_class' => 'AppBundle\Entity\User'
194+
'data_class' => 'AppBundle\Entity\User',
194195
));
195196
}
196197
}
@@ -200,7 +201,8 @@ There are just three fields: ``email``, ``username`` and ``plainPassword``
200201

201202
.. tip::
202203

203-
To explore more things about the Form component, read :doc:`/book/forms`.
204+
To explore more things about the Form component, read the
205+
:doc:`chapter about forms </book/forms>` in the book.
204206

205207
Handling the Form Submission
206208
----------------------------
@@ -212,12 +214,11 @@ into the database::
212214
// src/AppBundle/Controller/RegistrationController.php
213215
namespace AppBundle\Controller;
214216

215-
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
216-
217217
use AppBundle\Form\UserType;
218218
use AppBundle\Entity\User;
219-
use Symfony\Component\HttpFoundation\Request;
220219
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
220+
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
221+
use Symfony\Component\HttpFoundation\Request;
221222

222223
class RegistrationController extends Controller
223224
{
@@ -244,7 +245,7 @@ into the database::
244245
$em->persist($user);
245246
$em->flush();
246247

247-
// ... do any other work - like send them an email, etc
248+
// ... do any other work - like sending them an email, etc
248249
// maybe set a "flash" success message for the user
249250

250251
return $this->redirectToRoute('replace_with_some_route');
@@ -372,8 +373,8 @@ See :doc:`/cookbook/form/form_customization` for more details.
372373
Update your Database Schema
373374
---------------------------
374375

375-
If you've updated the User entity during this tutorial, you have to update your
376-
database schema using this command:
376+
If you've updated the ``User`` entity during this tutorial, you have to update
377+
your database schema using this command:
377378

378379
.. code-block:: bash
379380
@@ -405,9 +406,9 @@ return the ``email`` property::
405406
// ...
406407
}
407408

408-
Next, just update the ``providers`` section of your ``security.yml`` so that Symfony
409-
knows to load your users via the ``email`` property on login. See
410-
:ref:`authenticating-someone-with-a-custom-entity-provider`.
409+
Next, just update the ``providers`` section of your ``security.yml`` file
410+
so that Symfony knows how to load your users via the ``email`` property on
411+
login. See :ref:`authenticating-someone-with-a-custom-entity-provider`.
411412

412413
Adding a "accept terms" Checkbox
413414
--------------------------------

‎cookbook/doctrine/reverse_engineering.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,11 @@ The first command generates entity classes with annotation mappings. But
9999
if you want to use YAML or XML mapping instead of annotations, you should
100100
execute the second command only.
101101

102-
.. tip::
102+
.. caution::
103103

104-
If you want to use annotations, you can safely delete the XML (or YAML) files
105-
after running these two commands.
104+
If you want to use annotations, you must remove the XML (or YAML) files
105+
after running these two commands. This is necessary as
106+
:ref:`it is not possible to mix mapping configuration formats <book-doctrine-adding-mapping>`
106107

107108
For example, the newly created ``BlogComment`` entity class looks as follow::
108109

‎cookbook/map.rst.inc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767
* :doc:`/cookbook/deployment/azure-website`
6868
* :doc:`/cookbook/deployment/heroku`
6969
* :doc:`/cookbook/deployment/platformsh`
70+
* :doc:`/cookbook/deployment/fortrabbit`
7071

7172
* :doc:`/cookbook/doctrine/index`
7273

@@ -158,6 +159,7 @@
158159
* :doc:`/cookbook/routing/custom_route_loader`
159160
* :doc:`/cookbook/routing/redirect_trailing_slash`
160161
* :doc:`/cookbook/routing/extra_information`
162+
* :doc:`/cookbook/routing/routing_from_database`
161163

162164
* :doc:`Security Authentication (Identifying/Logging in the User) </cookbook/security/index>`
163165

‎cookbook/routing/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ Routing
1212
custom_route_loader
1313
redirect_trailing_slash
1414
extra_information
15+
routing_from_database
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
.. index::
2+
single: Routing; Extra Information
3+
4+
Looking up Routes from a Database: Symfony CMF DynamicRouter
5+
============================================================
6+
7+
The core Symfony Routing System is excellent at handling complex sets
8+
of routes. A highly optimized routing cache is dumped during
9+
deployments.
10+
11+
However, when working with large amounts of data that each need a nice
12+
readable URL (e.g. for search engine optimization purposes), the routing
13+
can get slowed down. Additionally, if routes need to be edited by users,
14+
the route cache would need to be rebuilt frequently.
15+
16+
For these cases, the ``DynamicRouter`` offers an alternative approach:
17+
18+
* Routes are stored in a database;
19+
* There is a database index on the path field, the lookup scales to huge
20+
numbers of different routes;
21+
* Writes only affect the index of the database, which is very efficient.
22+
23+
When all routes are known during deploy time and the number is not too
24+
high, using a :doc:`custom route loader <custom_route_loader>` is the
25+
preferred way to add more routes. When working with just one type of
26+
objects, a slug parameter on the object and the ``@ParamConverter``
27+
annotation work fine (see FrameworkExtraBundle_) .
28+
29+
The ``DynamicRouter`` is useful when you need ``Route`` objects with
30+
the full feature set of Symfony. Each route can define a specific
31+
controller so you can decouple the URL structure from your application
32+
logic.
33+
34+
The DynamicRouter comes with built-in support for Doctrine ORM and Doctrine
35+
PHPCR-ODM but offers the ``ContentRepositoryInterface`` to write a custom
36+
loader, e.g. for another database type or a REST API or anything else.
37+
38+
The DynamicRouter is explained in the `Symfony CMF documentation`_.
39+
40+
.. _FrameworkExtraBundle: https://symfony.com/doc/current/bundles/SensioFrameworkExtraBundle/annotations/converters.html
41+
.. _`Symfony CMF documentation`: http://symfony.com/doc/master/cmf/book/routing.html

‎cookbook/security/form_login_setup.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ When setting up your login form, watch out for a few common pitfalls.
294294
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
295295

296296
First, be sure that you've defined the ``/login`` route correctly and that
297-
it corresponds to the ``login_path`` and``check_path`` config values.
297+
it corresponds to the ``login_path`` and ``check_path`` config values.
298298
A misconfiguration here can mean that you're redirected to a 404 page instead
299299
of the login page, or that submitting the login form does nothing (you just see
300300
the login form over and over again).

‎cookbook/session/locale_sticky_session.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ how you determine the desired locale from the request::
5454
public static function getSubscribedEvents()
5555
{
5656
return array(
57-
// must be registered before the default Locale listener
58-
KernelEvents::REQUEST => array(array('onKernelRequest', 17)),
57+
// must be registered after the default Locale listener
58+
KernelEvents::REQUEST => array(array('onKernelRequest', 15)),
5959
);
6060
}
6161
}

‎reference/configuration/assetic.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ Full Default Configuration
5252
some_filter: []
5353
workers:
5454
# see https://github.com/symfony/AsseticBundle/pull/119
55-
# Cache can also be busted via the framework.templating.assets_version
55+
# Cache can also be busted via the framework.assets.version
5656
# setting - see the "framework" configuration section
5757
cache_busting:
5858
enabled: false

‎reference/configuration/framework.rst

Lines changed: 206 additions & 226 deletions
Large diffs are not rendered by default.

‎reference/forms/types/choice.rst

Lines changed: 84 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,19 @@ To use this field, you must specify *either* ``choices`` or ``choice_loader`` op
1313
| Rendered as | can be various tags (see below) |
1414
+-------------+------------------------------------------------------------------------------+
1515
| Options | - `choices`_ |
16-
| | - `choices_as_values`_ |
17-
| | - `choice_loader`_ |
18-
| | - `choice_label`_ |
1916
| | - `choice_attr`_ |
17+
| | - `choice_label`_ |
18+
| | - `choice_list`_ (deprecated) |
19+
| | - `choice_loader`_ |
20+
| | - `choice_name`_ |
2021
| | - `choice_translation_domain`_ |
21-
| | - `placeholder`_ |
22+
| | - `choice_value`_ |
23+
| | - `choices_as_values`_ |
2224
| | - `expanded`_ |
25+
| | - `group_by`_ |
2326
| | - `multiple`_ |
27+
| | - `placeholder`_ |
2428
| | - `preferred_choices`_ |
25-
| | - `group_by`_ |
26-
| | - `choice_value`_ |
27-
| | - `choice_name`_ |
28-
| | - `choice_list`_ (deprecated) |
2929
+-------------+------------------------------------------------------------------------------+
3030
| Overridden | - `compound`_ |
3131
| options | - `empty_data`_ |
@@ -185,83 +185,12 @@ is the item's label and the array value is the item's value::
185185
'choices_as_values' => true,
186186
));
187187

188-
choices_as_values
189-
~~~~~~~~~~~~~~~~~
190-
191-
**type**: ``boolean`` **default**: false
192-
193-
.. versionadded:: 2.7
194-
195-
The ``choices_as_values`` option was introduced in Symfony 2.7.
196-
197-
The ``choices_as_values`` option was added to keep backward compatibility with the
198-
*old* way of handling the ``choices`` option. When set to ``false`` (or omitted),
199-
the choice keys are used as the underlying value and the choice values are shown
200-
to the user.
201-
202-
* Before 2.7 (and deprecated now)::
203-
204-
$builder->add('gender', 'choice', array(
205-
// Shows "Male" to the user, returns "m" when selected
206-
'choices' => array('m' => 'Male', 'f' => 'Female'),
207-
// before 2.7, this option didn't actually exist, but the
208-
// behavior was equivalent to setting this to false in 2.7.
209-
'choices_as_values' => false,
210-
));
211-
212-
* Since 2.7::
213-
214-
$builder->add('gender', ChoiceType::class, array(
215-
// Shows "Male" to the user, returns "m" when selected
216-
'choices' => array('Male' => 'm', 'Female' => 'f'),
217-
'choices_as_values' => true,
218-
));
219-
220-
In Symfony 3.0, the ``choices_as_values`` option doesn't exist, but the ``choice``
221-
type behaves as if it were set to true:
222-
223-
* Default for 3.0::
224-
225-
$builder->add('gender', ChoiceType::class, array(
226-
'choices' => array('Male' => 'm', 'Female' => 'f'),
227-
));
228-
229-
choice_loader
230-
~~~~~~~~~~~~~
231-
232-
.. versionadded:: 2.7
233-
234-
The ``choice_loader`` option was added in Symfony 2.7.
235-
236-
**type**: :class:`Symfony\\Component\\Form\\ChoiceList\\Loader\\ChoiceLoaderInterface`
237-
238-
The ``choice_loader`` can be used to only partially load the choices in cases where
239-
a fully-loaded list is not necessary. This is only needed in advanced cases and
240-
would replace the ``choices`` option.
188+
.. include:: /reference/forms/types/options/choice_attr.rst.inc
241189

242190
.. _reference-form-choice-label:
243191

244192
.. include:: /reference/forms/types/options/choice_label.rst.inc
245193

246-
.. include:: /reference/forms/types/options/choice_attr.rst.inc
247-
248-
.. include:: /reference/forms/types/options/placeholder.rst.inc
249-
250-
.. include:: /reference/forms/types/options/choice_translation_domain.rst.inc
251-
252-
.. include:: /reference/forms/types/options/expanded.rst.inc
253-
254-
.. include:: /reference/forms/types/options/multiple.rst.inc
255-
256-
.. include:: /reference/forms/types/options/preferred_choices.rst.inc
257-
258-
.. include:: /reference/forms/types/options/group_by.rst.inc
259-
260-
.. include:: /reference/forms/types/options/choice_value.rst.inc
261-
262-
.. include:: /reference/forms/types/options/choice_name.rst.inc
263-
264-
265194
choice_list
266195
~~~~~~~~~~~
267196

@@ -293,6 +222,8 @@ For example::
293222

294223
The ``status`` field created by the code above will be rendered as:
295224

225+
.. code-block:: html
226+
296227
.. code-block:: html
297228

298229
<select name="status">
@@ -305,6 +236,79 @@ But don't be confused! If ``Full`` is selected (value ``0`` in HTML), ``1``
305236
will be returned in your form. If ``Almost empty`` is selected (value ``2``
306237
in HTML), ``0.1`` will be returned.
307238

239+
choice_loader
240+
~~~~~~~~~~~~~
241+
242+
.. versionadded:: 2.7
243+
244+
The ``choice_loader`` option was added in Symfony 2.7.
245+
246+
**type**: :class:`Symfony\\Component\\Form\\ChoiceList\\Loader\\ChoiceLoaderInterface`
247+
248+
The ``choice_loader`` can be used to only partially load the choices in cases where
249+
a fully-loaded list is not necessary. This is only needed in advanced cases and
250+
would replace the ``choices`` option.
251+
252+
.. include:: /reference/forms/types/options/choice_name.rst.inc
253+
254+
.. include:: /reference/forms/types/options/choice_translation_domain.rst.inc
255+
256+
.. include:: /reference/forms/types/options/choice_value.rst.inc
257+
258+
choices_as_values
259+
~~~~~~~~~~~~~~~~~
260+
261+
**type**: ``boolean`` **default**: false
262+
263+
.. versionadded:: 2.7
264+
265+
The ``choices_as_values`` option was introduced in Symfony 2.7.
266+
267+
The ``choices_as_values`` option was added to keep backward compatibility with the
268+
*old* way of handling the ``choices`` option. When set to ``false`` (or omitted),
269+
the choice keys are used as the underlying value and the choice values are shown
270+
to the user.
271+
272+
* Before 2.7 (and deprecated now)::
273+
274+
$builder->add('gender', 'choice', array(
275+
// Shows "Male" to the user, returns "m" when selected
276+
'choices' => array('m' => 'Male', 'f' => 'Female'),
277+
// before 2.7, this option didn't actually exist, but the
278+
// behavior was equivalent to setting this to false in 2.7.
279+
'choices_as_values' => false,
280+
));
281+
282+
* Since 2.7::
283+
284+
$builder->add('gender', ChoiceType::class, array(
285+
// Shows "Male" to the user, returns "m" when selected
286+
'choices' => array('Male' => 'm', 'Female' => 'f'),
287+
'choices_as_values' => true,
288+
));
289+
290+
In Symfony 3.0, the ``choices_as_values`` option doesn't exist, but the ``choice``
291+
type behaves as if it were set to true:
292+
293+
* Default for 3.0::
294+
295+
$builder->add('gender', ChoiceType::class, array(
296+
'choices' => array('Male' => 'm', 'Female' => 'f'),
297+
));
298+
299+
.. include:: /reference/forms/types/options/expanded.rst.inc
300+
301+
.. include:: /reference/forms/types/options/group_by.rst.inc
302+
303+
<<<<<<< HEAD
304+
=======
305+
.. include:: /reference/forms/types/options/multiple.rst.inc
306+
>>>>>>> 2.7
307+
308+
.. include:: /reference/forms/types/options/placeholder.rst.inc
309+
310+
.. include:: /reference/forms/types/options/preferred_choices.rst.inc
311+
308312
Overridden Options
309313
------------------
310314

‎reference/forms/types/country.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ the option manually, but then you should just use the ``ChoiceType`` directly.
2626
+-------------+-----------------------------------------------------------------------+
2727
| Inherited | from the :doc:`ChoiceType </reference/forms/types/choice>` |
2828
| options | |
29-
| | - `placeholder`_ |
3029
| | - `error_bubbling`_ |
3130
| | - `error_mapping`_ |
3231
| | - `expanded`_ |
3332
| | - `multiple`_ |
33+
| | - `placeholder`_ |
3434
| | - `preferred_choices`_ |
3535
| | |
3636
| | from the :doc:`FormType </reference/forms/types/form>` |
@@ -66,8 +66,6 @@ Inherited Options
6666

6767
These options inherit from the :doc:`ChoiceType </reference/forms/types/choice>`:
6868

69-
.. include:: /reference/forms/types/options/placeholder.rst.inc
70-
7169
.. include:: /reference/forms/types/options/error_bubbling.rst.inc
7270

7371
.. include:: /reference/forms/types/options/error_mapping.rst.inc
@@ -76,6 +74,8 @@ These options inherit from the :doc:`ChoiceType </reference/forms/types/choice>`
7674

7775
.. include:: /reference/forms/types/options/multiple.rst.inc
7876

77+
.. include:: /reference/forms/types/options/placeholder.rst.inc
78+
7979
.. include:: /reference/forms/types/options/preferred_choices.rst.inc
8080

8181
These options inherit from the :doc:`FormType </reference/forms/types/form>`:

‎reference/forms/types/currency.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ manually, but then you should just use the ``ChoiceType`` directly.
1919
+-------------+------------------------------------------------------------------------+
2020
| Inherited | from the :doc:`ChoiceType </reference/forms/types/choice>` |
2121
| options | |
22-
| | - `placeholder`_ |
2322
| | - `error_bubbling`_ |
2423
| | - `expanded`_ |
2524
| | - `multiple`_ |
25+
| | - `placeholder`_ |
2626
| | - `preferred_choices`_ |
2727
| | |
2828
| | from the :doc:`FormType </reference/forms/types/form>` type |
@@ -57,14 +57,14 @@ Inherited Options
5757

5858
These options inherit from the :doc:`ChoiceType </reference/forms/types/choice>`:
5959

60-
.. include:: /reference/forms/types/options/placeholder.rst.inc
61-
6260
.. include:: /reference/forms/types/options/error_bubbling.rst.inc
6361

6462
.. include:: /reference/forms/types/options/expanded.rst.inc
6563

6664
.. include:: /reference/forms/types/options/multiple.rst.inc
6765

66+
.. include:: /reference/forms/types/options/placeholder.rst.inc
67+
6868
.. include:: /reference/forms/types/options/preferred_choices.rst.inc
6969

7070
These options inherit from the :doc:`FormType </reference/forms/types/form>`:

‎reference/forms/types/entity.rst

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,13 @@ objects from the database.
1818
| | - `em`_ |
1919
+-------------+------------------------------------------------------------------+
2020
| Overridden | - `choices`_ |
21-
| options | |
21+
| options | - `data_class`_ |
2222
+-------------+------------------------------------------------------------------+
2323
| Inherited | from the :doc:`ChoiceType </reference/forms/types/choice>`: |
2424
| options | |
25+
| | - `choice_value`_ |
26+
| | - `choice_name`_ |
27+
| | - `choice_attr`_ |
2528
| | - `placeholder`_ |
2629
| | - `choice_translation_domain`_ |
2730
| | - `translation_domain`_ |
@@ -208,11 +211,25 @@ Instead of allowing the `class`_ and `query_builder`_ options to fetch the
208211
entities to include for you, you can pass the ``choices`` option directly.
209212
See :ref:`reference-forms-entity-choices`.
210213

214+
data_class
215+
~~~~~~~~~~
216+
217+
**type**: ``string`` **default**: ``null``
218+
219+
This option is not used in favor of the ``class`` option which is required
220+
to query the entities.
221+
211222
Inherited Options
212223
-----------------
213224

214225
These options inherit from the :doc:`ChoiceType </reference/forms/types/choice>`:
215226

227+
.. include:: /reference/forms/types/options/choice_value.rst.inc
228+
229+
.. include:: /reference/forms/types/options/choice_name.rst.inc
230+
231+
.. include:: /reference/forms/types/options/choice_attr.rst.inc
232+
216233
.. include:: /reference/forms/types/options/placeholder.rst.inc
217234

218235
.. include:: /reference/forms/types/options/choice_translation_domain.rst.inc

‎reference/forms/types/language.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ manually, but then you should just use the ``ChoiceType`` directly.
2727
+-------------+------------------------------------------------------------------------+
2828
| Inherited | from the :doc:`ChoiceType </reference/forms/types/choice>` |
2929
| options | |
30-
| | - `placeholder`_ |
3130
| | - `error_bubbling`_ |
3231
| | - `error_mapping`_ |
3332
| | - `expanded`_ |
3433
| | - `multiple`_ |
34+
| | - `placeholder`_ |
3535
| | - `preferred_choices`_ |
3636
| | |
3737
| | from the :doc:`FormType </reference/forms/types/form>` |
@@ -67,8 +67,6 @@ Inherited Options
6767

6868
These options inherit from the :doc:`ChoiceType </reference/forms/types/choice>`:
6969

70-
.. include:: /reference/forms/types/options/placeholder.rst.inc
71-
7270
.. include:: /reference/forms/types/options/error_bubbling.rst.inc
7371

7472
.. include:: /reference/forms/types/options/error_mapping.rst.inc
@@ -77,6 +75,8 @@ These options inherit from the :doc:`ChoiceType </reference/forms/types/choice>`
7775

7876
.. include:: /reference/forms/types/options/multiple.rst.inc
7977

78+
.. include:: /reference/forms/types/options/placeholder.rst.inc
79+
8080
.. include:: /reference/forms/types/options/preferred_choices.rst.inc
8181

8282
These options inherit from the :doc:`FormType </reference/forms/types/form>`:

‎reference/forms/types/locale.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ manually, but then you should just use the ``ChoiceType`` directly.
2929
+-------------+------------------------------------------------------------------------+
3030
| Inherited | from the :doc:`ChoiceType </reference/forms/types/choice>` |
3131
| options | |
32-
| | - `placeholder`_ |
3332
| | - `error_bubbling`_ |
3433
| | - `error_mapping`_ |
3534
| | - `expanded`_ |
3635
| | - `multiple`_ |
36+
| | - `placeholder`_ |
3737
| | - `preferred_choices`_ |
3838
| | |
3939
| | from the :doc:`FormType </reference/forms/types/form>` |
@@ -69,8 +69,6 @@ Inherited Options
6969

7070
These options inherit from the :doc:`ChoiceType </reference/forms/types/choice>`:
7171

72-
.. include:: /reference/forms/types/options/placeholder.rst.inc
73-
7472
.. include:: /reference/forms/types/options/error_bubbling.rst.inc
7573

7674
.. include:: /reference/forms/types/options/error_mapping.rst.inc
@@ -79,6 +77,8 @@ These options inherit from the :doc:`ChoiceType </reference/forms/types/choice>`
7977

8078
.. include:: /reference/forms/types/options/multiple.rst.inc
8179

80+
.. include:: /reference/forms/types/options/placeholder.rst.inc
81+
8282
.. include:: /reference/forms/types/options/preferred_choices.rst.inc
8383

8484
These options inherit from the :doc:`FormType </reference/forms/types/form>`:

‎reference/forms/types/options/preferred_choices.rst.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ This will "prefer" the "now" and "tomorrow" choices only:
4949
.. image:: /images/reference/form/choice-example3.png
5050
:align: center
5151

52-
Finally, if your values are objects, you can also specific a property path string
52+
Finally, if your values are objects, you can also specify a property path string
5353
on the object that will return true or false.
5454

5555
The preferred choices are only meaningful when rendering a ``select`` element

‎reference/forms/types/timezone.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ manually, but then you should just use the ``ChoiceType`` directly.
2222
+-------------+------------------------------------------------------------------------+
2323
| Inherited | from the :doc:`ChoiceType </reference/forms/types/choice>` |
2424
| options | |
25-
| | - `placeholder`_ |
2625
| | - `expanded`_ |
2726
| | - `multiple`_ |
27+
| | - `placeholder`_ |
2828
| | - `preferred_choices`_ |
2929
| | |
3030
| | from the :doc:`FormType </reference/forms/types/form>` |
@@ -62,12 +62,12 @@ Inherited Options
6262

6363
These options inherit from the :doc:`ChoiceType </reference/forms/types/choice>`:
6464

65-
.. include:: /reference/forms/types/options/placeholder.rst.inc
66-
6765
.. include:: /reference/forms/types/options/expanded.rst.inc
6866

6967
.. include:: /reference/forms/types/options/multiple.rst.inc
7068

69+
.. include:: /reference/forms/types/options/placeholder.rst.inc
70+
7171
.. include:: /reference/forms/types/options/preferred_choices.rst.inc
7272

7373
These options inherit from the :doc:`FormType </reference/forms/types/form>`:

‎reference/twig_reference.rst

Lines changed: 68 additions & 67 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)
Please sign in to comment.