Skip to content

Commit

Permalink
Applied comments by @xabbuh
Browse files Browse the repository at this point in the history
  • Loading branch information
wouterj committed Feb 19, 2014
1 parent 97d216d commit 398d23f
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 26 deletions.
12 changes: 6 additions & 6 deletions reference/forms/twig_reference.rst
Expand Up @@ -319,7 +319,7 @@ object:
+------------------------+-------------------------------------------------------------------------------------+
| Variable | Usage |
+========================+=====================================================================================+
| ``form`` | The current FormView instance |
| ``form`` | The current ``FormView`` instance |
+------------------------+-------------------------------------------------------------------------------------+
| ``id`` | The ``id`` HTML attribute to be rendered |
+------------------------+-------------------------------------------------------------------------------------+
Expand All @@ -331,8 +331,8 @@ object:
| ``errors`` | An array of any errors attached to *this* specific field |
| | (e.g. ``form.title.errors``). |
| | Note that you can't use ``form.errors`` to determine if a form is valid, |
| | since this only returns "global" errors: some individual fields may have errors |
| | Instead, use the ``valid`` option |
| | since this only returns "global" errors: some individual fields may have errors. |
| | Instead, use the ``valid`` option. |
+------------------------+-------------------------------------------------------------------------------------+
| ``valid`` | Returns ``true`` or ``false`` depending on whether the whole form is valid |
+------------------------+-------------------------------------------------------------------------------------+
Expand Down Expand Up @@ -365,13 +365,13 @@ object:
+------------------------+-------------------------------------------------------------------------------------+
| ``translation_domain`` | The domain of the translations for this form |
+------------------------+-------------------------------------------------------------------------------------+
| ``cache_key`` | An unique key which is used for caching |
| ``cache_key`` | A unique key which is used for caching |
+------------------------+-------------------------------------------------------------------------------------+
| ``data`` | The normalized data of the type |
+------------------------+-------------------------------------------------------------------------------------+
| ``method`` | The method of the current form (POST, GET, etc) |
| ``method`` | The method of the current form (POST, GET, etc.) |
+------------------------+-------------------------------------------------------------------------------------+
| ``action`` | The action of the current form (POST, GET, etc) |
| ``action`` | The action of the current form |
+------------------------+-------------------------------------------------------------------------------------+

.. _`form_div_layout.html.twig`: https://github.com/symfony/symfony/blob/master/src/Symfony/Bridge/Twig/Resources/views/Form/form_div_layout.html.twig
Expand Down
39 changes: 23 additions & 16 deletions reference/forms/types/choice.rst
Expand Up @@ -160,22 +160,29 @@ These options inherit from the :doc:`form </reference/forms/types/form>` type:
Field Variables
---------------

====================== ============ ================================================================
Variable Type Usage
====================== ============ ================================================================
multiple ``Boolean`` The value of the `multiple`_ option.
expanded ``Boolean`` The value of the `expanded`_ option.
preferred_choices ``array`` A nested array containing the ``ChoiceView`` objects of
choices which should be presented to the user with priority.
choices ``array`` A nested array containing the ``ChoiceView`` objects of
the remaining choices.
separator ``string`` The seperator to use between choice groups.
empty_value ``mixed`` The empty value if not already in the list, otherwise
``null``.
is_selected ``callable`` A callable which takes a ``ChoiceView`` and the selected value(s)
and returns whether the choice is in the selected value(s).
empty_value_in_choices ``Boolean`` Whether the empty value is in the choice list.
====================== ============ ================================================================
+------------------------+--------------+-------------------------------------------------------------------+
| Variable | Type | Usage |
+========================+==============+===================================================================+
| multiple | ``Boolean`` | The value of the `multiple`_ option. |
+------------------------+--------------+-------------------------------------------------------------------+
| expanded | ``Boolean`` | The value of the `expanded`_ option. |
+------------------------+--------------+-------------------------------------------------------------------+
| preferred_choices | ``array`` | A nested array containing the ``ChoiceView`` objects of |
| | | choices which should be presented to the user with priority. |
+------------------------+--------------+-------------------------------------------------------------------+
| choices | ``array`` | A nested array containing the ``ChoiceView`` objects of |
| | | the remaining choices. |
+------------------------+--------------+-------------------------------------------------------------------+
| separator | ``string`` | The seperator to use between choice groups. |
+------------------------+--------------+-------------------------------------------------------------------+
| empty_value | ``mixed`` | The empty value if not already in the list, otherwise |
| | | ``null``. |
+------------------------+--------------+-------------------------------------------------------------------+
| is_selected | ``callable`` | A callable which takes a ``ChoiceView`` and the selected value(s) |
| | | and returns whether the choice is in the selected value(s). |
+------------------------+--------------+-------------------------------------------------------------------+
| empty_value_in_choices | ``Boolean`` | Whether the empty value is in the choice list. |
+------------------------+--------------+-------------------------------------------------------------------+

.. tip::

Expand Down
8 changes: 4 additions & 4 deletions reference/forms/types/file.rst
Expand Up @@ -104,8 +104,8 @@ These options inherit from the :doc:`form </reference/forms/types/form>` type:
Form Variables
--------------

======== ========== ==========================================================================
======== ========== ==============================================================================
Variable Type Usage
======== ========== ==========================================================================
type ``string`` The type variable is set to ``file``, in order to render like a file input
======== ========== ==========================================================================
======== ========== ==============================================================================
type ``string`` The type variable is set to ``file``, in order to render as a file input field
======== ========== ==============================================================================

0 comments on commit 398d23f

Please sign in to comment.