1 | <?php |
||
7 | class Editable extends AbstractDisplayer |
||
8 | { |
||
9 | /** |
||
10 | * @var array |
||
11 | */ |
||
12 | protected $arguments = []; |
||
13 | |||
14 | /** |
||
15 | * Type of editable. |
||
16 | * |
||
17 | * @var string |
||
18 | */ |
||
19 | protected $type = ''; |
||
20 | |||
21 | /** |
||
22 | * Options of editable function. |
||
23 | * |
||
24 | * @var array |
||
25 | */ |
||
26 | protected $options = [ |
||
27 | 'emptytext' => '<i class="fa fa-pencil"></i>', |
||
28 | ]; |
||
29 | |||
30 | /** |
||
31 | * @var array |
||
32 | */ |
||
33 | protected $attributes = []; |
||
34 | |||
35 | /** |
||
36 | * Add options for editable. |
||
37 | * |
||
38 | * @param array $options |
||
39 | */ |
||
40 | public function addOptions($options = []) |
||
44 | |||
45 | /** |
||
46 | * Add attributes for editable. |
||
47 | * |
||
48 | * @param array $attributes |
||
49 | */ |
||
50 | public function addAttributes($attributes = []) |
||
54 | |||
55 | /** |
||
56 | * Text type editable. |
||
57 | */ |
||
58 | public function text() |
||
61 | |||
62 | /** |
||
63 | * Textarea type editable. |
||
64 | */ |
||
65 | public function textarea() |
||
68 | |||
69 | /** |
||
70 | * Select type editable. |
||
71 | * |
||
72 | * @param array|\Closure $options |
||
73 | */ |
||
74 | public function select($options = []) |
||
95 | |||
96 | /** |
||
97 | * Date type editable. |
||
98 | */ |
||
99 | public function date() |
||
103 | |||
104 | /** |
||
105 | * Datetime type editable. |
||
106 | */ |
||
107 | public function datetime() |
||
111 | |||
112 | /** |
||
113 | * Year type editable. |
||
114 | */ |
||
115 | public function year() |
||
119 | |||
120 | /** |
||
121 | * Month type editable. |
||
122 | */ |
||
123 | public function month() |
||
127 | |||
128 | /** |
||
129 | * Day type editable. |
||
130 | */ |
||
131 | public function day() |
||
135 | |||
136 | /** |
||
137 | * Combodate type editable. |
||
138 | * |
||
139 | * @param string $format |
||
140 | */ |
||
141 | public function combodate($format = 'YYYY-MM-DD') |
||
154 | |||
155 | protected function buildEditableOptions(array $arguments = []) |
||
161 | |||
162 | public function display() |
||
195 | } |
||
196 |