Conditions | 1 |
Paths | 1 |
Total Lines | 17 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
15 | public function updateCMSFields(FieldList $fields) |
||
16 | { |
||
17 | $types = Config::inst()->get('ContentBlock', 'types'); |
||
18 | $fields->addFieldToTab( |
||
19 | 'Root.ContentBlocks', |
||
20 | GridField::create( |
||
21 | 'ContentBlocks', |
||
22 | 'Content Blocks', |
||
23 | $this->owner->getComponents('ContentBlocks'), |
||
24 | GridFieldConfig_RecordEditor::create() |
||
25 | ->addComponent(new GridFieldOrderableRows('Sort')) |
||
26 | ->removeComponentsByType('GridFieldAddNewButton') |
||
27 | ->addComponent(GridFieldDropdownAddNewButton::create('ContentBlock', $types) |
||
28 | ->setButtonName('Add Content Block')) |
||
29 | ) |
||
30 | ); |
||
31 | } |
||
32 | } |
||
33 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.