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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Document the mapped formType option
  • Loading branch information
Grégoire Paris committed Nov 26, 2012
commit c70479aad812a6d6bb32cff893c1db4922724aa3
2 changes: 2 additions & 0 deletions reference/forms/types/form.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ on all fields.

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

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

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

.. include:: /reference/forms/types/options/attr.rst.inc
Expand Down
7 changes: 7 additions & 0 deletions reference/forms/types/options/mapped.rst.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
property_path
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops :) - be sure to change this to "mapped"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is what you get when copy/pasting too hastily :P Good catch!

~~~~~~~~~~~~~

**type**: ``boolean``

If you wish the field to be ignored when reading or writing to the object, you
can set the ``mapped`` option to ``false``
3 changes: 3 additions & 0 deletions reference/forms/types/options/property_path.rst.inc
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ name.

If you wish the field to be ignored when reading or writing to the object
you can set the ``property_path`` option to ``false``

.. versionadded:: 2.1
Since 2.1, the ``mapped`` option has been added for this use-case
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a perfect note, but actually the entire previous sentence needs to be changed as well. Setting property_path to false only works for 2.0, mapped completely replaces that for 2.1.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you dead sure about this? I just checked out origin/2.1, and there is a comment suggesting otherwise right here : https://github.com/symfony/symfony/blob/2.1/src/Symfony/Component/Form/Extension/Core/Type/FormType.php#L187 ...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, I think it's just there fore backwards compatibility. So, we should say that using property_path => false to disable mapping is now deprecated and to use mapped instead.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indeed, it is only kept for BC until 2.3

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@weaverryan : I added something to point that out.