| 1 | <?php |
||
| 6 | class MarkdownText extends HTMLText { |
||
|
|
|||
| 7 | |||
| 8 | /** |
||
| 9 | * Define the casting for field names and types |
||
| 10 | * @var array |
||
| 11 | */ |
||
| 12 | public static $casting = array( |
||
| 13 | 'MarkdownAsHTML' => 'MarkdownText', |
||
| 14 | 'MarkdownExtraAsHTML' => 'MarkdownText', |
||
| 15 | ); |
||
| 16 | |||
| 17 | /** |
||
| 18 | * Returns Markdown content as HTML for templates |
||
| 19 | * @return string HTML |
||
| 20 | */ |
||
| 21 | public function forTemplate() { |
||
| 24 | |||
| 25 | /** |
||
| 26 | * Return Markdown content as HTML |
||
| 27 | * @return string HTML |
||
| 28 | */ |
||
| 29 | public function MarkdownAsHTML() { |
||
| 33 | |||
| 34 | /** |
||
| 35 | * Return MarkdownExtra content as HTML |
||
| 36 | * @return string HTML |
||
| 37 | */ |
||
| 38 | public function MarkdownExtraAsHTML() { |
||
| 42 | |||
| 43 | /** |
||
| 44 | * Return an instance of the MarkdownTextareaField |
||
| 45 | * @param string $title |
||
| 46 | * @param array $params |
||
| 47 | * @return MarkdownTextareaField |
||
| 48 | */ |
||
| 49 | public function scaffoldFormField($title = null, $params = null) { |
||
| 52 | |||
| 53 | } |
||
| 54 |
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.