Skip to content

Commit 4b49fbc

Browse files
committed
[cookbook][form] Making clarifications to the "virtual" default option
This backports some changes from PR #1585, which is against the master branch
1 parent 193d41b commit 4b49fbc

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

cookbook/form/use_virtuals_forms.rst

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,13 @@ location form type::
9292
->add('country', 'text');
9393
}
9494

95+
public function getDefaultOptions(array $options)
96+
{
97+
return array(
98+
'virtual' => true,
99+
);
100+
}
101+
95102
public function getName()
96103
{
97104
return 'location';
@@ -124,7 +131,7 @@ Look at the result::
124131
}
125132
126133
With the virtual option set to false (default behavior), the Form Component
127-
expect each underlying object to have a ``foo`` (or ``bar``) property that
134+
expects each underlying object to have a ``foo`` (or ``bar``) property that
128135
is either some object or array which contains the four location fields.
129136
Of course, we don't have this object/array in our entities and we don't want it!
130137

0 commit comments

Comments
 (0)