| 1 | <?php |
||
| 7 | class HtmlSerializer extends ViewableData implements IRestSerializer { |
||
|
|
|||
| 8 | |||
| 9 | /** |
||
| 10 | * @config |
||
| 11 | */ |
||
| 12 | private static $is_active = true; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * The content type |
||
| 16 | * @var string |
||
| 17 | */ |
||
| 18 | private $contentType = "text/html"; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * The given data will be serialized into an html string using a Silverstripe template. |
||
| 22 | * |
||
| 23 | * @param array $data |
||
| 24 | * @return string an html string |
||
| 25 | */ |
||
| 26 | public function serialize($data) { |
||
| 30 | |||
| 31 | public function contentType() { |
||
| 34 | |||
| 35 | private function recursive($data, $level) { |
||
| 49 | |||
| 50 | /** |
||
| 51 | * Indicates if the serializer is active. |
||
| 52 | * Serializers can be deactivated to use another implementation for the same mime type. |
||
| 53 | * |
||
| 54 | * @return boolean |
||
| 55 | */ |
||
| 56 | public function active() { |
||
| 59 | } |
||
| 60 |
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.