Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added some codes boxes and inc files
- Loading branch information
Showing
3 changed files
with
37 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
* ``data`` [type: any, default: the field's initial value] | ||
When you create a form, each field initially displays the value of the | ||
corresponding property of the form's domain object. If you want to override | ||
this initial value, you can set it in the data option. | ||
|
||
.. code-block:: php | ||
|
||
use Symfony\Component\Form\HiddenField | ||
|
||
$field = new HiddenField('token', array( | ||
'data' => 'abcdef', | ||
)); | ||
assert('abcdef' === $field->getData()); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
* ``disabled`` [type: Boolean, default: false] | ||
If you don't want a user to modify the value of a field, you can set | ||
the disabled option to true. Any submitted value will be ignored. | ||
|
||
.. code-block:: php | ||
|
||
use Symfony\Component\Form\TextField | ||
|
||
$field = new TextField('status', array( | ||
'data' => 'Old data', | ||
'disabled' => true, | ||
)); | ||
$field->submit('New data'); | ||
|
||
assert('Old data' === $field->getData()); | ||
|
||
|