Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fixed spelling and grammar errors
  • Loading branch information
webmozart committed Apr 13, 2013
commit 88b88e5bb47b0f39a634c6efc409902db3359a57
9 changes: 5 additions & 4 deletions book/forms.rst
Original file line number Diff line number Diff line change
Expand Up @@ -291,11 +291,11 @@ Let's add a second button with the caption "Save and add" to our form::
->getForm();

In your controller, use the button's
:method:`Symfony\\Component\\Form\\ClickableInterface\\isClicked` method for
:method:`Symfony\\Component\\Form\\ClickableInterface::isClicked` method for
querying if the "Save and add" button was clicked::

if ($form->isValid()) {
// perform some action, such as saving the task to the database
// ... perform some action, such as saving the task to the database

$nextAction = $form->get('saveAndAdd')->isClicked()
? 'task_new'
Expand Down Expand Up @@ -454,8 +454,9 @@ Disabling Validation
~~~~~~~~~~~~~~~~~~~~

.. versionadded:: 2.3
The ability to set ``validation_groups`` to false is new to version 2.3.
Setting it to an empty array was already supported before.
The ability to set ``validation_groups`` to false was added in Symfony 2.3,
although setting it to an empty array achieved the same result in previous
versions.

Sometimes it is useful to suppress the validation of a form altogether. For
these cases, you can skip the call to :method:`Symfony\\Component\\Form\\FormInterface::isValid`
Expand Down
26 changes: 13 additions & 13 deletions reference/forms/types/button.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@ button Field Type
=================

.. versionadded:: 2.3
The ``button`` type is new in version 2.3
The ``button`` type was added in Symfony 2.3

A simple, non-responsive button.

+----------------------+------------------------------------------------------------------------------------------------------------------------+
| Rendered as | ``button`` tag |
+----------------------+------------------------------------------------------------------------------------------------------------------------+
| Options | - `attr`_ |
| | - `disabled`_ |
| | - `label`_ |
| | - `translation_domain`_ |
+----------------------+------------------------------------------------------------------------------------------------------------------------+
| Parent type | none |
+----------------------+------------------------------------------------------------------------------------------------------------------------+
| Class | :class:`Symfony\\Component\\Form\\Extension\\Core\\Type\\ButtonType` |
+----------------------+------------------------------------------------------------------------------------------------------------------------+
+----------------------+----------------------------------------------------------------------+
| Rendered as | ``button`` tag |
+----------------------+----------------------------------------------------------------------+
| Options | - `attr`_ |
| | - `disabled`_ |
| | - `label`_ |
| | - `translation_domain`_ |
+----------------------+----------------------------------------------------------------------+
| Parent type | none |
+----------------------+----------------------------------------------------------------------+
| Class | :class:`Symfony\\Component\\Form\\Extension\\Core\\Type\\ButtonType` |
+----------------------+----------------------------------------------------------------------+

Options
-------
Expand Down
2 changes: 1 addition & 1 deletion reference/forms/types/options/button_disabled.rst.inc
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ disabled

If you don't want a user to be able to click a button, you can set the disabled
option to true. It will not be possible to submit the form with this button,
not even when bypassing the browser and sending an request manually, for
not even when bypassing the browser and sending a request manually, for
example with cURL.
12 changes: 9 additions & 3 deletions reference/forms/types/options/button_label.rst.inc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,13 @@ label

Sets the label that will be displayed on the button. The label can also be
directly set inside the template:

.. code-block:: jinja

{{ form_widget(form.save, { 'label': 'Click me' }) }}
.. configuration-block::

.. code-block:: html+jinja

{{ form_widget(form.save, { 'label': 'Click me' }) }}

.. code-block:: html+php

<?php echo $view['form']->widget($form['save'], array('label' => 'Click me')) ?>
26 changes: 13 additions & 13 deletions reference/forms/types/reset.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@ reset Field Type
================

.. versionadded:: 2.3
The ``submit`` type is new in version 2.3
The ``reset`` type was added in Symfony 2.3

A button that resets all fields to their original values.

+----------------------+------------------------------------------------------------------------------------------------------------------------+
| Rendered as | ``input`` ``reset`` tag |
+----------------------+------------------------------------------------------------------------------------------------------------------------+
| Inherited | - `attr`_ |
| options | - `disabled`_ |
| | - `label`_ |
| | - `translation_domain`_ |
+----------------------+------------------------------------------------------------------------------------------------------------------------+
| Parent type | :doc:`button</reference/forms/types/button>` |
+----------------------+------------------------------------------------------------------------------------------------------------------------+
| Class | :class:`Symfony\\Component\\Form\\Extension\\Core\\Type\\ResetType` |
+----------------------+------------------------------------------------------------------------------------------------------------------------+
+----------------------+---------------------------------------------------------------------+
| Rendered as | ``input`` ``reset`` tag |
+----------------------+---------------------------------------------------------------------+
| Inherited | - `attr`_ |
| options | - `disabled`_ |
| | - `label`_ |
| | - `translation_domain`_ |
+----------------------+---------------------------------------------------------------------+
| Parent type | :doc:`button</reference/forms/types/button>` |
+----------------------+---------------------------------------------------------------------+
| Class | :class:`Symfony\\Component\\Form\\Extension\\Core\\Type\\ResetType` |
+----------------------+---------------------------------------------------------------------+

Inherited options
-----------------
Expand Down
28 changes: 14 additions & 14 deletions reference/forms/types/submit.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,25 @@ submit Field Type
=================

.. versionadded:: 2.3
The ``submit`` type is new in version 2.3
The ``submit`` type was added in Symfony 2.3

A submit button.

+----------------------+------------------------------------------------------------------------------------------------------------------------+
| Rendered as | ``input`` ``submit`` tag |
+----------------------+------------------------------------------------------------------------------------------------------------------------+
| Inherited | - `attr`_ |
| options | - `disabled`_ |
| | - `label`_ |
| | - `translation_domain`_ |
+----------------------+------------------------------------------------------------------------------------------------------------------------+
| Parent type | :doc:`button</reference/forms/types/button>` |
+----------------------+------------------------------------------------------------------------------------------------------------------------+
| Class | :class:`Symfony\\Component\\Form\\Extension\\Core\\Type\\SubmitType` |
+----------------------+------------------------------------------------------------------------------------------------------------------------+
+----------------------+----------------------------------------------------------------------+
| Rendered as | ``input`` ``submit`` tag |
+----------------------+----------------------------------------------------------------------+
| Inherited | - `attr`_ |
| options | - `disabled`_ |
| | - `label`_ |
| | - `translation_domain`_ |
+----------------------+----------------------------------------------------------------------+
| Parent type | :doc:`button</reference/forms/types/button>` |
+----------------------+----------------------------------------------------------------------+
| Class | :class:`Symfony\\Component\\Form\\Extension\\Core\\Type\\SubmitType` |
+----------------------+----------------------------------------------------------------------+

Submit buttons feature an additional method
:method:`Symfony\\Component\\Form\\ClickableInterface\\isClicked` that lets you
:method:`Symfony\\Component\\Form\\ClickableInterface::isClicked` that lets you
check whether this button was used to submit the forms. This is especially
useful when :ref:`a form has multiple submit buttons <book-form-submitting-multiple-buttons>`::

Expand Down