mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
Update DropdownField.php
Update to DropdownField::create, and in one instance set the Empty Title on the instantiation, rather than afterwards.
This commit is contained in:
parent
f636d15332
commit
ff67b5ba84
@ -13,8 +13,8 @@
|
|||||||
*
|
*
|
||||||
* public function getCMSFields() {
|
* public function getCMSFields() {
|
||||||
* $fields = parent::getCMSFields();
|
* $fields = parent::getCMSFields();
|
||||||
* $field = DropdownField::create('GalleryID', 'Gallery', Gallery::get()->map('ID', 'Title'));
|
* $field = DropdownField::create('GalleryID', 'Gallery', Gallery::get()->map('ID', 'Title'))
|
||||||
* $field->setEmptyString('(Select one)');
|
* ->setEmptyString('(Select one)');
|
||||||
* $fields->addFieldToTab('Root.Content', $field, 'Content');
|
* $fields->addFieldToTab('Root.Content', $field, 'Content');
|
||||||
* </code>
|
* </code>
|
||||||
*
|
*
|
||||||
@ -33,7 +33,7 @@
|
|||||||
*
|
*
|
||||||
* Example instantiation:
|
* Example instantiation:
|
||||||
* <code>
|
* <code>
|
||||||
* new DropdownField(
|
* DropdownField::create(
|
||||||
* 'Country',
|
* 'Country',
|
||||||
* 'Country',
|
* 'Country',
|
||||||
* array(
|
* array(
|
||||||
@ -59,7 +59,7 @@
|
|||||||
*
|
*
|
||||||
* Field construction:
|
* Field construction:
|
||||||
* <code>
|
* <code>
|
||||||
* new DropdownField(
|
* DropdownField::create(
|
||||||
* 'Country',
|
* 'Country',
|
||||||
* 'Country',
|
* 'Country',
|
||||||
* singleton('MyObject')->dbObject('Country')->enumValues()
|
* singleton('MyObject')->dbObject('Country')->enumValues()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user