for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
Template override extension for the model
1) Adds an AlternativeTemplate field
2) Ability to edit that
*/
class TemplateOverrideExtension extends DataExtension
You can fix this by adding a namespace to your class:
namespace YourVendor; class YourClass { }
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.
{
private static $db = array('AlternativeTemplate' => 'Varchar');
public function updateCMSFields(FieldList $fields)
$templatei18n = _t('TemplateOverride.TEMPLATE', 'Template');
$fields->addFieldToTab('Root.'.$templatei18n, new TextField('AlternativeTemplate',
_t('TemplateOverride.ALTERNATIVE_TEMPLATE_NAME', 'Alternative template name')));
$info_field = new LiteralField(
$name = 'infofield',
$content = '<p class="message">'._t('TemplateOverride.INFO', 'If you wish to change'.
' the default template, type the name of the template here. Otherwise '.
' the normal default template will be used. Normally this will not '.
' require changing.').'</p>'
);
$fields->addFieldToTab('Root.'.$templatei18n, $info_field);
}
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.