Skip to content

Commit 3642eed

Browse files
committed
[reference][forms] Tweaking some reference
1 parent 7a10c94 commit 3642eed

File tree

4 files changed

+23
-21
lines changed

4 files changed

+23
-21
lines changed

reference/forms/types/map.rst.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,5 +51,5 @@ Hidden Fields
5151
Base Fields
5252
~~~~~~~~~~~
5353

54-
* :doc:`hidden</reference/forms/types/hidden>`
54+
* :doc:`field</reference/forms/types/field>`
5555
* :doc:`form</reference/forms/types/form>`
Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
* ``data`` [type: any, default: the field's initial value]
2-
When you create a form, each field initially displays the value of the
3-
corresponding property of the form's domain object. If you want to override
4-
this initial value, you can set it in the data option.
2+
When you create a form, each field initially displays the value of the
3+
corresponding property of the form's domain object. If you want to override
4+
this initial value, you can set it in the data option.
55

6-
.. code-block:: php
6+
.. code-block:: php
77

8-
use Symfony\Component\Form\HiddenField
8+
use Symfony\Component\Form\HiddenField
99

10-
$field = new HiddenField('token', array(
11-
'data' => 'abcdef',
12-
));
13-
assert('abcdef' === $field->getData());
10+
$field = new HiddenField('token', array(
11+
'data' => 'abcdef',
12+
));
13+
14+
// renders abcdef
15+
echo $field->getData();
1416

1517

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
* ``disabled`` [type: Boolean, default: false]
2-
If you don't want a user to modify the value of a field, you can set
3-
the disabled option to true. Any submitted value will be ignored.
2+
If you don't want a user to modify the value of a field, you can set
3+
the disabled option to true. Any submitted value will be ignored.
44

5-
.. code-block:: php
5+
.. code-block:: php
66

7-
use Symfony\Component\Form\TextField
7+
use Symfony\Component\Form\TextField
88

9-
$field = new TextField('status', array(
10-
'data' => 'Old data',
11-
'disabled' => true,
12-
));
13-
$field->submit('New data');
9+
$field = new TextField('status', array(
10+
'data' => 'Old data',
11+
'disabled' => true,
12+
));
13+
$field->submit('New data');
1414

15-
assert('Old data' === $field->getData());
15+
// prints "Old data"
16+
echo $field->getData();
1617

1718

reference/forms/types/options/preferred_choices.rst.inc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
* ``preferred_choices`` [type: array]
32
If this option is specified, then a sub-set of the total number of options
43
will be moved to the top of the select menu. The following would move

0 commit comments

Comments
 (0)