| 1 | <?php |
||
| 3 | class PageControllerTemplateOverrideExtension extends Extension |
||
|
|
|||
| 4 | { |
||
| 5 | /* |
||
| 6 | If the alternative template exists, render that, otherwise render with the default template |
||
| 7 | */ |
||
| 8 | 3 | public function index() |
|
| 12 | |||
| 13 | /** |
||
| 14 | * Render this page using the template override iff it exists. |
||
| 15 | * |
||
| 16 | * @return array An array suitable for SilverStripe to use the correct template |
||
| 17 | */ |
||
| 18 | 3 | public function useTemplateOverride($data = null) |
|
| 36 | } |
||
| 37 |
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.