Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitdb3cde7

Browse files
committed
featuresymfony#3124 Add note about the property attribute (Property Accessor) (raziel057)
This PR was submitted for the 2.2 branch but it was merged into the 2.3 branch instead (closessymfony#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.rst7496e68 Update entity.rstc097f9b Update entity.rst7d65fed Update entity.rst6af779d Add note about the property attribute (Property Accessor)
2 parentsbafd7ad +d1ca515 commitdb3cde7

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

‎reference/forms/types/entity.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,20 @@ This is the property that should be used for displaying the entities
118118
as text in the HTML element. If left blank, the entity object will be
119119
cast into a string and so must have a ``__toString()`` method.
120120

121+
..note::
122+
123+
The ``property`` option is the property path used to display the option. So you
124+
can use anything supported by the
125+
:doc:`PropertyAccessor component</components/property_access/introduction>`
126+
127+
For example, if the translations property is actually an associative array of
128+
objects, each with a name property, then you could do this::
129+
130+
$builder->add('gender', 'entity', array(
131+
'class' => 'MyBundle:Gender',
132+
'property' => 'translations[en].name',
133+
));
134+
121135
group_by
122136
~~~~~~~~
123137

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp