Skip to content

Commit

Permalink
Merge branch '2.7' into 2.8
Browse files Browse the repository at this point in the history
Conflicts:
	reference/forms/types/button.rst
	reference/forms/types/date.rst
	reference/forms/types/reset.rst
	reference/forms/types/submit.rst
  • Loading branch information
wouterj committed Feb 6, 2016
2 parents b56880b + 309d29f commit fe2e8e7
Show file tree
Hide file tree
Showing 10 changed files with 140 additions and 15 deletions.
51 changes: 50 additions & 1 deletion cookbook/controller/error_pages.rst
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,56 @@ will be passed two parameters:
Instead of creating a new exception controller from scratch you can, of course,
also extend the default :class:`Symfony\\Bundle\\TwigBundle\\Controller\\ExceptionController`.
In that case, you might want to override one or both of the ``showAction()`` and
``findTemplate()`` methods. The latter one locates the template to be used.
``findTemplate()`` methods. The latter one locates the template to be used.

.. note::

In case of extending the
:class:`Symfony\\Bundle\\TwigBundle\\Controller\\ExceptionController` you
may configure a service to pass the Twig environment and the ``debug`` flag
to the constructor.

.. configuration-block::

.. code-block:: yaml
# app/config/services.yml
services:
app.exception_controller:
class: AppBundle\CustomExceptionController
arguments: ['@twig', '%kernel.debug%']
.. code-block:: xml
<!-- app/config/services.xml -->
<?xml version="1.0" encoding="utf-8" ?>
<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd"
>
<services>
<service id="app.exception_controller"
class="AppBundle\Controller\CustomExceptionController"
>
<argument type="service" id="twig"/>
<argument>%kernel.debug%</argument>
</service>
</services>
</container>
.. code-block:: php
// app/config/services.php
use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\DependencyInjection\Definition;
$definition = new Definition('AppBundle\Controller\CustomExceptionController', array(
new Reference('twig'),
'%kernel.debug%'
));
And then configure ``twig.exception_controller`` using the controller as
services syntax (e.g. ``app.exception_controller:showAction``).

.. tip::

Expand Down
2 changes: 1 addition & 1 deletion cookbook/email/gmail.rst
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ that you `allow less secure apps to access your Gmail account`_.

.. seealso::

see the :doc:`Swiftmailer configuration reference </reference/configuration/swiftmailer>`
See the :doc:`Swiftmailer configuration reference </reference/configuration/swiftmailer>`
for more details.

.. _`generate an App password`: https://support.google.com/accounts/answer/185833
Expand Down
2 changes: 1 addition & 1 deletion reference/configuration/framework.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1487,7 +1487,7 @@ cache
**type**: ``string``

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

.. seealso::

Expand Down
26 changes: 25 additions & 1 deletion reference/forms/types/birthday.rst
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,31 @@ These options inherit from the :doc:`DateType </reference/forms/types/date>`:

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

.. include:: /reference/forms/types/options/placeholder.rst.inc
placeholder
~~~~~~~~~~~

.. versionadded:: 2.6
The ``placeholder`` option was introduced in Symfony 2.6 and replaces
``empty_value``, which is available prior to 2.6.

**type**: ``string`` | ``array``

If your widget option is set to ``choice``, then this field will be represented
as a series of ``select`` boxes. When the placeholder value is a string,
it will be used as the **blank value** of all select boxes::

$builder->add('birthdate', 'birthday', array(
'placeholder' => 'Select a value',
));

Alternatively, you can use an array that configures different placeholder
values for the year, month and day fields::

$builder->add('birthdate', 'birthday', array(
'placeholder' => array(
'year' => 'Year', 'month' => 'Month', 'day' => 'Day',
)
));

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

Expand Down
2 changes: 1 addition & 1 deletion reference/forms/types/button.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ButtonType Field
================

.. versionadded:: 2.3
The ``ButtonType`` was introduced in Symfony 2.3
The ``ButtonType`` was introduced in Symfony 2.3.

A simple, non-responsive button.

Expand Down
15 changes: 9 additions & 6 deletions reference/forms/types/date.rst
Original file line number Diff line number Diff line change
Expand Up @@ -90,20 +90,23 @@ Field Options
placeholder
~~~~~~~~~~~

**type**: ``string`` or ``array``
**type**: ``string`` | ``array``

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

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

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

$builder->add('dueDate', DateType::class, array(
'placeholder' => array('year' => 'Year', 'month' => 'Month', 'day' => 'Day')
'placeholder' => array(
'year' => 'Year', 'month' => 'Month', 'day' => 'Day'
)
));

.. _reference-forms-type-date-format:
Expand Down
27 changes: 26 additions & 1 deletion reference/forms/types/datetime.rst
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,32 @@ date_widget

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

.. include:: /reference/forms/types/options/placeholder.rst.inc
placeholder
~~~~~~~~~~~

.. versionadded:: 2.6
The ``placeholder`` option was introduced in Symfony 2.6 and replaces
``empty_value``, which is available prior to 2.6.

**type**: ``string`` | ``array``

If your widget option is set to ``choice``, then this field will be represented
as a series of ``select`` boxes. When the placeholder value is a string,
it will be used as the **blank value** of all select boxes::

$builder->add('startDateTime', 'datetime', array(
'placeholder' => 'Select a value',
));

Alternatively, you can use an array that configures different placeholder
values for the year, month, day, hour, minute and second fields::

$builder->add('startDateTime', 'datetime', array(
'placeholder' => array(
'year' => 'Year', 'month' => 'Month', 'day' => 'Day',
'hour' => 'Hour', 'minute' => 'Minute', 'second' => 'Second',
)
));

format
~~~~~~
Expand Down
2 changes: 1 addition & 1 deletion reference/forms/types/reset.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ResetType Field
===============

.. versionadded:: 2.3
The ``ResetType`` was introduced in Symfony 2.3
The ``ResetType`` was introduced in Symfony 2.3.

A button that resets all fields to their original values.

Expand Down
2 changes: 1 addition & 1 deletion reference/forms/types/submit.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ SubmitType Field
================

.. versionadded:: 2.3
The ``SubmitType`` type was introduced in Symfony 2.3
The ``SubmitType`` type was introduced in Symfony 2.3.

A submit button.

Expand Down
26 changes: 25 additions & 1 deletion reference/forms/types/time.rst
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,31 @@ values.
Field Options
-------------

.. include:: /reference/forms/types/options/placeholder.rst.inc
placeholder
~~~~~~~~~~~

.. versionadded:: 2.6
The ``placeholder`` option was introduced in Symfony 2.6 and replaces
``empty_value``, which is available prior to 2.6.

**type**: ``string`` | ``array``

If your widget option is set to ``choice``, then this field will be represented
as a series of ``select`` boxes. When the placeholder value is a string,
it will be used as the **blank value** of all select boxes::

$builder->add('startTime', 'time', array(
'placeholder' => 'Select a value',
));

Alternatively, you can use an array that configures different placeholder
values for the hour, minute and second fields::

$builder->add('startTime', 'time', array(
'placeholder' => array(
'hour' => 'Hour', 'minute' => 'Minute', 'second' => 'Second',
)
));

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

Expand Down

0 comments on commit fe2e8e7

Please sign in to comment.