1 | <?php |
||
12 | class Field extends Fluent |
||
13 | { |
||
14 | /** |
||
15 | * Field type. |
||
16 | * |
||
17 | * @var string |
||
18 | */ |
||
19 | protected $type = 'text'; |
||
20 | |||
21 | /** |
||
22 | * Password constructor. |
||
23 | */ |
||
24 | public function __construct($attributes = []) |
||
30 | |||
31 | /** |
||
32 | * @param string $name |
||
33 | * @param string $label |
||
34 | * @return Field|Select|Password|DateTime|Checkbox|Radio|Hidden|ReadOnly|TextArea |
||
35 | */ |
||
36 | public static function make($name, $label = '') |
||
49 | |||
50 | /** |
||
51 | * @param string $label |
||
52 | * @return $this |
||
53 | * @see https://editor.datatables.net/reference/option/fields.label |
||
54 | */ |
||
55 | public function label($label) |
||
61 | |||
62 | /** |
||
63 | * @param string $name |
||
64 | * @return $this |
||
65 | * @see https://editor.datatables.net/reference/option/fields.name |
||
66 | */ |
||
67 | public function name($name) |
||
73 | |||
74 | /** |
||
75 | * @param string $data |
||
76 | * @return $this |
||
77 | * @see https://editor.datatables.net/reference/option/fields.data |
||
78 | */ |
||
79 | public function data($data) |
||
85 | |||
86 | /** |
||
87 | * @param string $type |
||
88 | * @return $this |
||
89 | * @see https://editor.datatables.net/reference/option/fields.type |
||
90 | */ |
||
91 | public function type($type) |
||
97 | |||
98 | /** |
||
99 | * Get options from a model. |
||
100 | * |
||
101 | * @param mixed $model |
||
102 | * @param string $value |
||
103 | * @param string $key |
||
104 | * @return Field |
||
105 | */ |
||
106 | public function modelOptions($model, $value, $key = 'id') |
||
112 | |||
113 | /** |
||
114 | * Set select options. |
||
115 | * |
||
116 | * @param array|mixed $options |
||
117 | * @return $this |
||
118 | */ |
||
119 | public function options($options) |
||
129 | |||
130 | /** |
||
131 | * Get options from a table. |
||
132 | * |
||
133 | * @param mixed $table |
||
134 | * @param string $value |
||
135 | * @param string $key |
||
136 | * @param \Closure $whereCallback |
||
137 | * @param string|null $key |
||
138 | * @return Field |
||
139 | */ |
||
140 | public function tableOptions($table, $value, $key = 'id', \Closure $whereCallback = null, $connection = null) |
||
146 | |||
147 | /** |
||
148 | * Set checkbox separator. |
||
149 | * |
||
150 | * @param string $separator |
||
151 | * @return $this |
||
152 | */ |
||
153 | public function separator($separator = ',') |
||
159 | |||
160 | /** |
||
161 | * Set dateTime format. |
||
162 | * |
||
163 | * @param string $format |
||
164 | * @return $this |
||
165 | * @see https://editor.datatables.net/reference/field/datetime |
||
166 | */ |
||
167 | public function format($format) |
||
173 | |||
174 | /** |
||
175 | * Set field default value. |
||
176 | * |
||
177 | * @param mixed $value |
||
178 | * @return $this |
||
179 | * @see https://editor.datatables.net/reference/option/fields.def |
||
180 | */ |
||
181 | public function default($value) |
||
187 | |||
188 | /** |
||
189 | * Set field message value. |
||
190 | * |
||
191 | * @param string $value |
||
192 | * @return $this |
||
193 | * @see https://editor.datatables.net/reference/option/fields.message |
||
194 | */ |
||
195 | public function message($value) |
||
201 | |||
202 | /** |
||
203 | * Set field fieldInfo value. |
||
204 | * |
||
205 | * @param string $value |
||
206 | * @return $this |
||
207 | * @see https://editor.datatables.net/reference/option/fields.fieldInfo |
||
208 | */ |
||
209 | public function fieldInfo($value) |
||
215 | |||
216 | /** |
||
217 | * Set field labelInfo value. |
||
218 | * |
||
219 | * @param string $value |
||
220 | * @return $this |
||
221 | * @see https://editor.datatables.net/reference/option/fields.labelInfo |
||
222 | */ |
||
223 | public function labelInfo($value) |
||
229 | |||
230 | /** |
||
231 | * Set field entityDecode value. |
||
232 | * |
||
233 | * @param mixed|bool $value |
||
234 | * @return $this |
||
235 | * @see https://editor.datatables.net/reference/option/fields.entityDecode |
||
236 | */ |
||
237 | public function entityDecode($value) |
||
243 | |||
244 | /** |
||
245 | * Set field multiEditable value. |
||
246 | * |
||
247 | * @param mixed|bool $value |
||
248 | * @return $this |
||
249 | * @see https://editor.datatables.net/reference/option/fields.multiEditable |
||
250 | */ |
||
251 | public function multiEditable($value) |
||
257 | |||
258 | /** |
||
259 | * Set field id value. |
||
260 | * |
||
261 | * @param string $value |
||
262 | * @return $this |
||
263 | * @see https://editor.datatables.net/reference/option/fields.id |
||
264 | */ |
||
265 | public function id($value) |
||
271 | |||
272 | /** |
||
273 | * Set field submit value. |
||
274 | * |
||
275 | * @param bool $value |
||
276 | * @return $this |
||
277 | * @see https://editor.datatables.net/reference/option/fields.submit |
||
278 | */ |
||
279 | public function submit($value) |
||
285 | |||
286 | /** |
||
287 | * Set field compare value. |
||
288 | * |
||
289 | * @param bool $value |
||
290 | * @return $this |
||
291 | * @see https://editor.datatables.net/reference/option/fields.compare |
||
292 | */ |
||
293 | public function compare($value) |
||
299 | } |
||
300 |