mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
MINOR Update class docs for OptionsetField to use short DataList query
This commit is contained in:
parent
862d7f249b
commit
71256ea7f8
@ -28,22 +28,19 @@
|
||||
*
|
||||
* <code>
|
||||
* //Database request for the object
|
||||
* $myDoSet = DataList::create("FooBars","");
|
||||
* if($myDoSet){
|
||||
* // This returns an array of ID => Title
|
||||
* $map = $myDoSet->map();
|
||||
*
|
||||
* // Instantiate the OptionsetField
|
||||
* $FieldList = new FieldList(
|
||||
* new OptionsetField(
|
||||
* $name = "Foobar",
|
||||
* $title = "FooBar's optionset",
|
||||
* $source = $map,
|
||||
* $value = $map[0]
|
||||
* )
|
||||
* );
|
||||
* }
|
||||
*
|
||||
* $map = FooBar::get()->map();
|
||||
* // returns an SS_Map object containing an array of ID => Title
|
||||
*
|
||||
* // Instantiate the OptionsetField
|
||||
* $FieldList = new FieldList(
|
||||
* new OptionsetField(
|
||||
* $name = "Foobar",
|
||||
* $title = "FooBar's optionset",
|
||||
* $source = $map,
|
||||
* $value = $map[0]
|
||||
* )
|
||||
* );
|
||||
*
|
||||
* // Pass the fields to the form constructor. etc
|
||||
* </code>
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user