for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
class PageControllerTemplateOverrideExtension extends Extension
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.
{
/*
If the alternative template exists, render that, otherwise render with the default template
*/
public function index()
return $this->useTemplateOverride();
}
/**
* Render this page using the template override iff it exists.
*
* @return array An array suitable for SilverStripe to use the correct template
public function useTemplateOverride($data = null)
$template = $this->owner->AlternativeTemplate;
if (isset($template) && $template != '') {
if ($data) {
return $this->owner->customise(new ArrayData($data))
->renderWith(array($this->owner->AlternativeTemplate, $this->owner->ClassName, 'Page'));
} else {
return $this->owner->renderWith(array($this->owner->AlternativeTemplate, $this->owner->ClassName, 'Page'));
return $data;
return array();
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.