1 | <?php |
||
3 | class MarkdownTextareaField extends TextareaField { |
||
|
|||
4 | |||
5 | /** |
||
6 | * Define the actions allowed on this field |
||
7 | * @var array |
||
8 | */ |
||
9 | private static $allowed_actions = array( |
||
10 | 'preview', |
||
11 | 'parse' |
||
12 | ); |
||
13 | |||
14 | /** |
||
15 | * @var int Visible number of text lines. |
||
16 | * Default on TextareaField is too small |
||
17 | */ |
||
18 | protected $rows = 15; |
||
19 | |||
20 | /** |
||
21 | * Toggle rendering markdown with extra syntax enabled. |
||
22 | * @link http://michelf.ca/projects/php-markdown/extra |
||
23 | * @var boolean |
||
24 | */ |
||
25 | protected $enable_extra = false; |
||
26 | |||
27 | /** |
||
28 | * Returns the field holder used by templates |
||
29 | * @return string HTML to be used |
||
30 | */ |
||
31 | public function FieldHolder($properties = array()) { |
||
44 | |||
45 | /** |
||
46 | * Turn on extra syntax support |
||
47 | * @return MarkdownTextareaField |
||
48 | */ |
||
49 | public function enableExtra() { |
||
53 | |||
54 | |||
55 | /** |
||
56 | * Body for the preview iframe with just the typography styles included |
||
57 | * @return string html |
||
58 | */ |
||
59 | public function preview() { |
||
65 | |||
66 | /** |
||
67 | * Parse markdown into html |
||
68 | * @return string html |
||
69 | */ |
||
70 | public function parse() { |
||
75 | |||
76 | /** |
||
77 | * Get buttons described in buttons.yml and wrap them in ViewableData |
||
78 | * @return ArrayList list of buttons and theyr configurations |
||
79 | */ |
||
80 | public function ToolbarButtons() { |
||
89 | |||
90 | } |
||
91 |
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.