Conditions | 1 |
Paths | 1 |
Total Lines | 16 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 13 |
CRAP Score | 1 |
1 | <?php |
||
11 | 1 | public function updateCMSFields(FieldList $fields) |
|
12 | { |
||
13 | 1 | $templatei18n = _t('TemplateOverride.TEMPLATE', 'Template'); |
|
14 | 1 | $fields->addFieldToTab('Root.'.$templatei18n, new TextField('AlternativeTemplate', |
|
15 | 1 | _t('TemplateOverride.ALTERNATIVE_TEMPLATE_NAME', 'Alternative template name'))); |
|
16 | |||
17 | 1 | $info_field = new LiteralField( |
|
18 | 1 | $name = 'infofield', |
|
19 | 1 | $content = '<p class="message">'._t('TemplateOverride.INFO', 'If you wish to change'. |
|
20 | 1 | ' the default template, type the name of the template here. Otherwise '. |
|
21 | 1 | ' the normal default template will be used. Normally this will not '. |
|
22 | 1 | ' require changing.').'</p>' |
|
23 | 1 | ); |
|
24 | |||
25 | 1 | $fields->addFieldToTab('Root.'.$templatei18n, $info_field); |
|
26 | 1 | } |
|
27 | } |
||
28 |
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.