Permalink
Browse files

feature #3124 Add note about the property attribute (Property Accesso…

…r) (raziel057)

This PR was submitted for the 2.2 branch but it was merged into the 2.3 branch instead (closes #3124).

Discussion
----------

Add note about the property attribute (Property Accessor)

I think we must document the fact that propety is a path which is evaluted by the PropertyAccessor component.

Commits
-------

46f1b8b Update entity.rst
7496e68 Update entity.rst
c097f9b Update entity.rst
7d65fed Update entity.rst
6af779d Add note about the property attribute (Property Accessor)
  • Loading branch information...
weaverryan committed Mar 18, 2014
2 parents bafd7ad + d1ca515 commit db3cde7ddf7929da282cfc70e8a8b524ffb72f11
Showing with 14 additions and 0 deletions.
  1. +14 −0 reference/forms/types/entity.rst
@@ -118,6 +118,20 @@ This is the property that should be used for displaying the entities
as text in the HTML element. If left blank, the entity object will be
cast into a string and so must have a ``__toString()`` method.
.. note::
The ``property`` option is the property path used to display the option. So you
can use anything supported by the
:doc:`PropertyAccessor component </components/property_access/introduction>`
For example, if the translations property is actually an associative array of
objects, each with a name property, then you could do this::
$builder->add('gender', 'entity', array(
'class' => 'MyBundle:Gender',
'property' => 'translations[en].name',
));
group_by
~~~~~~~~

0 comments on commit db3cde7

Please sign in to comment.