Skip to content

Commit fe2e8e7

Browse files
committed
Merge branch '2.7' into 2.8
Conflicts: reference/forms/types/button.rst reference/forms/types/date.rst reference/forms/types/reset.rst reference/forms/types/submit.rst
2 parents b56880b + 309d29f commit fe2e8e7

File tree

10 files changed

+140
-15
lines changed

10 files changed

+140
-15
lines changed

cookbook/controller/error_pages.rst

+50-1
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,56 @@ will be passed two parameters:
251251
Instead of creating a new exception controller from scratch you can, of course,
252252
also extend the default :class:`Symfony\\Bundle\\TwigBundle\\Controller\\ExceptionController`.
253253
In that case, you might want to override one or both of the ``showAction()`` and
254-
``findTemplate()`` methods. The latter one locates the template to be used.
254+
``findTemplate()`` methods. The latter one locates the template to be used.
255+
256+
.. note::
257+
258+
In case of extending the
259+
:class:`Symfony\\Bundle\\TwigBundle\\Controller\\ExceptionController` you
260+
may configure a service to pass the Twig environment and the ``debug`` flag
261+
to the constructor.
262+
263+
.. configuration-block::
264+
265+
.. code-block:: yaml
266+
267+
# app/config/services.yml
268+
services:
269+
app.exception_controller:
270+
class: AppBundle\CustomExceptionController
271+
arguments: ['@twig', '%kernel.debug%']
272+
273+
.. code-block:: xml
274+
275+
<!-- app/config/services.xml -->
276+
<?xml version="1.0" encoding="utf-8" ?>
277+
<container xmlns="http://symfony.com/schema/dic/services"
278+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
279+
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd"
280+
>
281+
<services>
282+
<service id="app.exception_controller"
283+
class="AppBundle\Controller\CustomExceptionController"
284+
>
285+
<argument type="service" id="twig"/>
286+
<argument>%kernel.debug%</argument>
287+
</service>
288+
</services>
289+
</container>
290+
291+
.. code-block:: php
292+
293+
// app/config/services.php
294+
use Symfony\Component\DependencyInjection\Reference;
295+
use Symfony\Component\DependencyInjection\Definition;
296+
297+
$definition = new Definition('AppBundle\Controller\CustomExceptionController', array(
298+
new Reference('twig'),
299+
'%kernel.debug%'
300+
));
301+
302+
And then configure ``twig.exception_controller`` using the controller as
303+
services syntax (e.g. ``app.exception_controller:showAction``).
255304

256305
.. tip::
257306

cookbook/email/gmail.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ that you `allow less secure apps to access your Gmail account`_.
129129

130130
.. seealso::
131131

132-
see the :doc:`Swiftmailer configuration reference </reference/configuration/swiftmailer>`
132+
See the :doc:`Swiftmailer configuration reference </reference/configuration/swiftmailer>`
133133
for more details.
134134

135135
.. _`generate an App password`: https://support.google.com/accounts/answer/185833

reference/configuration/framework.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -1487,7 +1487,7 @@ cache
14871487
**type**: ``string``
14881488

14891489
The service that is used to persist class metadata in a cache. The service
1490-
has to implement the :class:`Doctrine\\Common\\Cache\\Cache` interface.
1490+
has to implement the ``Doctrine\Common\Cache\Cache`` interface.
14911491

14921492
.. seealso::
14931493

reference/forms/types/birthday.rst

+25-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,31 @@ These options inherit from the :doc:`DateType </reference/forms/types/date>`:
6666

6767
.. include:: /reference/forms/types/options/days.rst.inc
6868

69-
.. include:: /reference/forms/types/options/placeholder.rst.inc
69+
placeholder
70+
~~~~~~~~~~~
71+
72+
.. versionadded:: 2.6
73+
The ``placeholder`` option was introduced in Symfony 2.6 and replaces
74+
``empty_value``, which is available prior to 2.6.
75+
76+
**type**: ``string`` | ``array``
77+
78+
If your widget option is set to ``choice``, then this field will be represented
79+
as a series of ``select`` boxes. When the placeholder value is a string,
80+
it will be used as the **blank value** of all select boxes::
81+
82+
$builder->add('birthdate', 'birthday', array(
83+
'placeholder' => 'Select a value',
84+
));
85+
86+
Alternatively, you can use an array that configures different placeholder
87+
values for the year, month and day fields::
88+
89+
$builder->add('birthdate', 'birthday', array(
90+
'placeholder' => array(
91+
'year' => 'Year', 'month' => 'Month', 'day' => 'Day',
92+
)
93+
));
7094

7195
.. include:: /reference/forms/types/options/date_format.rst.inc
7296

reference/forms/types/button.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ ButtonType Field
55
================
66

77
.. versionadded:: 2.3
8-
The ``ButtonType`` was introduced in Symfony 2.3
8+
The ``ButtonType`` was introduced in Symfony 2.3.
99

1010
A simple, non-responsive button.
1111

reference/forms/types/date.rst

+9-6
Original file line numberDiff line numberDiff line change
@@ -90,20 +90,23 @@ Field Options
9090
placeholder
9191
~~~~~~~~~~~
9292

93-
**type**: ``string`` or ``array``
93+
**type**: ``string`` | ``array``
9494

9595
If your widget option is set to ``choice``, then this field will be represented
96-
as a series of ``select`` boxes. The ``placeholder`` option can be used
97-
to add a "blank" entry to the top of each select box::
96+
as a series of ``select`` boxes. When the placeholder value is a string,
97+
it will be used as the **blank value** of all select boxes::
9898

9999
$builder->add('dueDate', DateType::class, array(
100-
'placeholder' => '',
100+
'placeholder' => 'Select a value',
101101
));
102102

103-
Alternatively, you can specify a string to be displayed for the "blank" value::
103+
Alternatively, you can use an array that configures different placeholder
104+
values for the year, month and day fields::
104105

105106
$builder->add('dueDate', DateType::class, array(
106-
'placeholder' => array('year' => 'Year', 'month' => 'Month', 'day' => 'Day')
107+
'placeholder' => array(
108+
'year' => 'Year', 'month' => 'Month', 'day' => 'Day'
109+
)
107110
));
108111

109112
.. _reference-forms-type-date-format:

reference/forms/types/datetime.rst

+26-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,32 @@ date_widget
7171

7272
.. include:: /reference/forms/types/options/days.rst.inc
7373

74-
.. include:: /reference/forms/types/options/placeholder.rst.inc
74+
placeholder
75+
~~~~~~~~~~~
76+
77+
.. versionadded:: 2.6
78+
The ``placeholder`` option was introduced in Symfony 2.6 and replaces
79+
``empty_value``, which is available prior to 2.6.
80+
81+
**type**: ``string`` | ``array``
82+
83+
If your widget option is set to ``choice``, then this field will be represented
84+
as a series of ``select`` boxes. When the placeholder value is a string,
85+
it will be used as the **blank value** of all select boxes::
86+
87+
$builder->add('startDateTime', 'datetime', array(
88+
'placeholder' => 'Select a value',
89+
));
90+
91+
Alternatively, you can use an array that configures different placeholder
92+
values for the year, month, day, hour, minute and second fields::
93+
94+
$builder->add('startDateTime', 'datetime', array(
95+
'placeholder' => array(
96+
'year' => 'Year', 'month' => 'Month', 'day' => 'Day',
97+
'hour' => 'Hour', 'minute' => 'Minute', 'second' => 'Second',
98+
)
99+
));
75100

76101
format
77102
~~~~~~

reference/forms/types/reset.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ ResetType Field
55
===============
66

77
.. versionadded:: 2.3
8-
The ``ResetType`` was introduced in Symfony 2.3
8+
The ``ResetType`` was introduced in Symfony 2.3.
99

1010
A button that resets all fields to their original values.
1111

reference/forms/types/submit.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ SubmitType Field
55
================
66

77
.. versionadded:: 2.3
8-
The ``SubmitType`` type was introduced in Symfony 2.3
8+
The ``SubmitType`` type was introduced in Symfony 2.3.
99

1010
A submit button.
1111

reference/forms/types/time.rst

+25-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,31 @@ values.
8282
Field Options
8383
-------------
8484

85-
.. include:: /reference/forms/types/options/placeholder.rst.inc
85+
placeholder
86+
~~~~~~~~~~~
87+
88+
.. versionadded:: 2.6
89+
The ``placeholder`` option was introduced in Symfony 2.6 and replaces
90+
``empty_value``, which is available prior to 2.6.
91+
92+
**type**: ``string`` | ``array``
93+
94+
If your widget option is set to ``choice``, then this field will be represented
95+
as a series of ``select`` boxes. When the placeholder value is a string,
96+
it will be used as the **blank value** of all select boxes::
97+
98+
$builder->add('startTime', 'time', array(
99+
'placeholder' => 'Select a value',
100+
));
101+
102+
Alternatively, you can use an array that configures different placeholder
103+
values for the hour, minute and second fields::
104+
105+
$builder->add('startTime', 'time', array(
106+
'placeholder' => array(
107+
'hour' => 'Hour', 'minute' => 'Minute', 'second' => 'Second',
108+
)
109+
));
86110

87111
.. include:: /reference/forms/types/options/hours.rst.inc
88112

0 commit comments

Comments
 (0)