| 1 | <?php |
||
| 3 | class ChecIOExtension extends SiteTreeExtension |
||
|
|
|||
| 4 | { |
||
| 5 | /** |
||
| 6 | * Loads the third party javascript during Controller->init() |
||
| 7 | */ |
||
| 8 | public function contentcontrollerInit() |
||
| 14 | |||
| 15 | /** |
||
| 16 | * Tries to fetch the inline chec.io JS from cache, failing which it gets it from the URL. |
||
| 17 | * Should your theme clear requirements, placing this before the closing body tag ensures |
||
| 18 | * that it always gets loaded. |
||
| 19 | * @return string |
||
| 20 | */ |
||
| 21 | public function getChecIOJs() |
||
| 28 | } |
||
| 29 |
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.