Skip to content

Commit

Permalink
Merge branch '2.7' into 2.8
Browse files Browse the repository at this point in the history
* 2.7: (26 commits)
  moving options below basic usage
  changing a few orders of sections - mostly to move overridden after the main options
  Rewrite note a bit
  fix capitalization
  [Cookbook][Assetic] complete a sentence
  Fixed a typo
  Reordered two overridden options
  Added missing types in overridden options
  Fixed the order of the different options
  Fixed the order of the different options
  Improved the explanation about the "compoun" option
  Fixer minor issues
  Fixed errors noticed by Wouter
  Removed a duplicated "trim" option in the "password" type
  Removed again a duplicated option explanation
  Removed a duplicated option explanation in "file" type
  Extracted the common "data_class" option explanation for data-related types
  Documented the overridden options of "date" type
  Documented overridden options for "file" type
  Documented the overridden options of the "password" type
  ...
  • Loading branch information
weaverryan committed Jun 28, 2015
2 parents a45a393 + 21c7666 commit acff5b0
Show file tree
Hide file tree
Showing 23 changed files with 155 additions and 35 deletions.
3 changes: 2 additions & 1 deletion cookbook/assetic/php.rst
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@ formatter used by the filter to produce the compiled CSS file. Using the
compressed formatter will minimize the the resulting file, regardless of whether
the original files are regular CSS files or SCSS files.

Next, your Twig template to add the ``{% stylesheets %}`` tag defined by Assetic:
Next, update your Twig template to add the ``{% stylesheets %}`` tag defined
by Assetic:

.. code-block:: html+jinja

Expand Down
6 changes: 6 additions & 0 deletions cookbook/form/form_customization.rst
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,12 @@ fragment needed to render every part of a form:
but the CSS classes applied are the ones used to display the forms horizontally
(i.e. the label and the widget in the same row).

.. caution::

When you use the Bootstrap form themes and render the fields manually,
calling ``form_label()`` for a checkbox/radio field doesn't show anything.
Due to Bootstrap internals, the label is already shown by ``form_widget()``.

In the next section you will learn how to customize a theme by overriding
some or all of its fragments.

Expand Down
2 changes: 1 addition & 1 deletion cookbook/security/form_login_setup.rst
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ firewall matches *all* URLs, including ``/login_check``). If ``/login_check``
doesn't match any firewall, you'll receive a ``Unable to find the controller
for path "/login_check"`` exception.

4. Multiple Firewalls Don't Share the same Security Context
4. Multiple Firewalls Don't Share the Same Security Context
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

If you're using multiple firewalls and you authenticate against one firewall,
Expand Down
2 changes: 1 addition & 1 deletion reference/forms/types/country.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ you should just use the ``choice`` type directly.
| Rendered as | can be various tags (see :ref:`forms-reference-choice-tags`) |
+-------------+-----------------------------------------------------------------------+
| Overridden | - `choices`_ |
| Options | |
| options | |
+-------------+-----------------------------------------------------------------------+
| Inherited | from the :doc:`choice </reference/forms/types/choice>` type |
| options | |
Expand Down
2 changes: 1 addition & 1 deletion reference/forms/types/currency.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ you should just use the ``choice`` type directly.
| Rendered as | can be various tags (see :ref:`forms-reference-choice-tags`) |
+-------------+------------------------------------------------------------------------+
| Overridden | - `choices`_ |
| Options | |
| options | |
+-------------+------------------------------------------------------------------------+
| Inherited | from the :doc:`choice </reference/forms/types/choice>` type |
| options | |
Expand Down
8 changes: 7 additions & 1 deletion reference/forms/types/date.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ day and year) or three select boxes (see the `widget`_ option).
| | - `widget`_ |
| | - `years`_ |
+----------------------+-----------------------------------------------------------------------------+
| Overridden Options | - `by_reference`_ |
| Overridden options | - `by_reference`_ |
| | - `compound`_ |
| | - `data_class`_ |
| | - `error_bubbling`_ |
+----------------------+-----------------------------------------------------------------------------+
| Inherited | - `data`_ |
Expand Down Expand Up @@ -132,6 +134,10 @@ by_reference

The ``DateTime`` classes are treated as immutable objects.

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

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

error_bubbling
~~~~~~~~~~~~~~

Expand Down
24 changes: 24 additions & 0 deletions reference/forms/types/datetime.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ the data can be a ``DateTime`` object, a string, a timestamp or an array.
| | - `with_seconds`_ |
| | - `years`_ |
+----------------------+-----------------------------------------------------------------------------+
| Overridden options | - `by_reference`_ |
| | - `compound`_ |
| | - `data_class`_ |
| | - `error_bubbling`_ |
+----------------------+-----------------------------------------------------------------------------+
| Inherited | - `data`_ |
| options | - `disabled`_ |
| | - `inherit_data`_ |
Expand Down Expand Up @@ -134,6 +139,25 @@ with the `date_widget`_ and `time_widget`_ options.

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

Overridden Options
------------------

by_reference
~~~~~~~~~~~~

**default**: ``false``

The ``DateTime`` classes are treated as immutable objects.

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

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

error_bubbling
~~~~~~~~~~~~~~

**default**: ``false``

Inherited Options
-----------------

Expand Down
2 changes: 1 addition & 1 deletion reference/forms/types/entity.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ objects from the database.
| | - `property`_ |
| | - `query_builder`_ |
+-------------+------------------------------------------------------------------+
| Overriden | - `choice_list`_ |
| Overridden | - `choice_list`_ |
| options | - `choices`_ |
+-------------+------------------------------------------------------------------+
| Inherited | from the :doc:`choice </reference/forms/types/choice>` type: |
Expand Down
35 changes: 25 additions & 10 deletions reference/forms/types/file.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,12 @@ The ``file`` type represents a file input in your form.
+-------------+---------------------------------------------------------------------+
| Options | - `multiple`_ |
+-------------+---------------------------------------------------------------------+
| Overridden | - `compound`_ |
| options | - `data_class`_ |
| | - `empty_data`_ |
+-------------+---------------------------------------------------------------------+
| Inherited | - `disabled`_ |
| options | - `empty_data`_ |
| | - `error_bubbling`_ |
| options | - `error_bubbling`_ |
| | - `error_mapping`_ |
| | - `label`_ |
| | - `label_attr`_ |
Expand Down Expand Up @@ -86,6 +89,26 @@ multiple

When set to true, the user will be able to upload multiple files at the same time.

Overridden Options
------------------

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

data_class
~~~~~~~~~~

**type**: ``string`` **default**: :class:`Symfony\\Component\\HttpFoundation\\File\\File`

This option sets the appropriate file-related data mapper to be used by the type.

empty_data
~~~~~~~~~~

**type**: ``mixed`` **default**: ``null``

This option determines what value the field will return when the submitted
value is empty.

Inherited Options
-----------------

Expand All @@ -94,14 +117,6 @@ type:

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

.. include:: /reference/forms/types/options/empty_data.rst.inc
:end-before: DEFAULT_PLACEHOLDER

The default value is ``null``.

.. include:: /reference/forms/types/options/empty_data.rst.inc
:start-after: DEFAULT_PLACEHOLDER

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

.. include:: /reference/forms/types/options/error_mapping.rst.inc
Expand Down
7 changes: 5 additions & 2 deletions reference/forms/types/hidden.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ The hidden type represents a hidden input field.
+-------------+----------------------------------------------------------------------+
| Rendered as | ``input`` ``hidden`` field |
+-------------+----------------------------------------------------------------------+
| Overriden | - `error_bubbling`_ |
| options | - `required`_ |
| Overriden | - `compound`_ |
| options | - `error_bubbling`_ |
| | - `required`_ |
+-------------+----------------------------------------------------------------------+
| Inherited | - `data`_ |
| options | - `error_mapping`_ |
Expand All @@ -25,6 +26,8 @@ The hidden type represents a hidden input field.
Overridden Options
------------------

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

error_bubbling
~~~~~~~~~~~~~~

Expand Down
8 changes: 8 additions & 0 deletions reference/forms/types/integer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ integers. By default, all non-integer values (e.g. 6.78) will round down
| | - `scale`_ |
| | - `rounding_mode`_ |
+-------------+-----------------------------------------------------------------------+
| Overridden | - `compound`_ |
| options | |
+-------------+-----------------------------------------------------------------------+
| Inherited | - `data`_ |
| options | - `disabled`_ |
| | - `empty_data`_ |
Expand Down Expand Up @@ -74,6 +77,11 @@ on the :class:`Symfony\\Component\\Form\\Extension\\Core\\DataTransformer\\Integ
* ``IntegerToLocalizedStringTransformer::ROUND_HALF_UP`` Round towards the
"nearest neighbor". If both neighbors are equidistant, round up.

Overridden Options
------------------

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

Inherited Options
-----------------

Expand Down
2 changes: 1 addition & 1 deletion reference/forms/types/language.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ you should just use the ``choice`` type directly.
| Rendered as | can be various tags (see :ref:`forms-reference-choice-tags`) |
+-------------+------------------------------------------------------------------------+
| Overridden | - `choices`_ |
| Options | |
| options | |
+-------------+------------------------------------------------------------------------+
| Inherited | from the :doc:`choice </reference/forms/types/choice>` type |
| options | |
Expand Down
2 changes: 1 addition & 1 deletion reference/forms/types/locale.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ you should just use the ``choice`` type directly.
| Rendered as | can be various tags (see :ref:`forms-reference-choice-tags`) |
+-------------+------------------------------------------------------------------------+
| Overridden | - `choices`_ |
| Options | |
| options | |
+-------------+------------------------------------------------------------------------+
| Inherited | from the :doc:`choice </reference/forms/types/choice>` type |
| options | |
Expand Down
8 changes: 8 additions & 0 deletions reference/forms/types/money.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ how the input and output of the data is handled.
| | - `grouping`_ |
| | - `scale`_ |
+-------------+---------------------------------------------------------------------+
| Overridden | - `compound`_ |
| options | |
+-------------+---------------------------------------------------------------------+
| Inherited | - `data`_ |
| options | - `disabled`_ |
| | - `empty_data`_ |
Expand Down Expand Up @@ -87,6 +90,11 @@ you can modify this value. You probably won't need to do this unless,
for example, you want to round to the nearest dollar (set the scale
to ``0``).

Overridden Options
------------------

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

Inherited Options
-----------------

Expand Down
8 changes: 8 additions & 0 deletions reference/forms/types/number.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ that you want to use for your number.
| | - `scale`_ |
| | - `rounding_mode`_ |
+-------------+----------------------------------------------------------------------+
| Overridden | - `compound`_ |
| options | |
+-------------+----------------------------------------------------------------------+
| Inherited | - `data`_ |
| options | - `disabled`_ |
| | - `empty_data`_ |
Expand Down Expand Up @@ -69,6 +72,11 @@ option is a constant on the :class:`Symfony\\Component\\Form\\Extension\\Core\\D
* ``NumberToLocalizedStringTransformer::ROUND_HALF_UP`` Round towards the
"nearest neighbor". If both neighbors are equidistant, round up.

Overridden Options
------------------

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

Inherited Options
-----------------

Expand Down
8 changes: 8 additions & 0 deletions reference/forms/types/options/compound_type.rst.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
compound
~~~~~~~~

**type**: ``boolean`` **default**: ``false``

This option specifies whether the type contains child types or not. This option
is managed internally for built-in types, so there is no need to configure
it explicitly.
8 changes: 8 additions & 0 deletions reference/forms/types/options/data_class_date.rst.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
data_class
~~~~~~~~~~

**type**: ``string`` **default**: ``null``

The internal normalized representation of this type is an array, not a ``\DateTime``
object. Therefore, the ``data_class`` option is initialized to ``null`` to avoid
the ``FormType`` object from initializing it to ``\DateTime``.
26 changes: 15 additions & 11 deletions reference/forms/types/password.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ The ``password`` field renders an input password text box.
+-------------+------------------------------------------------------------------------+
| Options | - `always_empty`_ |
+-------------+------------------------------------------------------------------------+
| Overridden | - `trim`_ |
| options | |
+-------------+------------------------------------------------------------------------+
| Inherited | - `disabled`_ |
| options | - `empty_data`_ |
| | - `error_bubbling`_ |
Expand All @@ -21,7 +24,6 @@ The ``password`` field renders an input password text box.
| | - `max_length`_ (deprecated as of 2.5) |
| | - `read_only`_ (deprecated as of 2.8) |
| | - `required`_ |
| | - `trim`_ |
+-------------+------------------------------------------------------------------------+
| Parent type | :doc:`text </reference/forms/types/text>` |
+-------------+------------------------------------------------------------------------+
Expand All @@ -44,6 +46,18 @@ Put simply, if for some reason you want to render your password field
*with* the password value already entered into the box, set this to false
and submit the form.

Overridden Options
------------------

trim
~~~~

**type**: ``boolean`` **default**: ``false``

Unlike the rest of form types, the ``password`` type doesn't apply the
:phpfunction:`trim` function to the value submitted by the user. This ensures that
the password is merged back onto the underlying object exactly as it was typed
by the user.

Inherited Options
-----------------
Expand Down Expand Up @@ -76,13 +90,3 @@ The default value is ``''`` (the empty string).
.. include:: /reference/forms/types/options/read_only.rst.inc

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

trim
~~~~

**type**: ``boolean`` **default**: ``false``

If true, the whitespace of the submitted string value will be stripped
via the :phpfunction:`trim` function when the data is bound. This guarantees
that if a value is submitted with extra whitespace, it will be removed before
the value is merged back onto the underlying object.
8 changes: 8 additions & 0 deletions reference/forms/types/percent.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ This field adds a percentage sign "``%``" after the input box.
| Options | - `scale`_ |
| | - `type`_ |
+-------------+-----------------------------------------------------------------------+
| Overridden | - `compound`_ |
| options | |
+-------------+-----------------------------------------------------------------------+
| Inherited | - `data`_ |
| options | - `disabled`_ |
| | - `empty_data`_ |
Expand Down Expand Up @@ -71,6 +74,11 @@ object. The two "types" handle these two cases:
The raw value (``55``) is shown to the user and stored on your object.
Note that this only works for integer values.

Overridden Options
------------------

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

Inherited Options
-----------------

Expand Down
Loading

0 comments on commit acff5b0

Please sign in to comment.