1 | <?php |
||
7 | trait HasEditor |
||
8 | { |
||
9 | /** |
||
10 | * Collection of Editors. |
||
11 | * |
||
12 | * @var null|Editor |
||
13 | */ |
||
14 | protected $editors = []; |
||
15 | |||
16 | /** |
||
17 | * Attach multiple editors to builder. |
||
18 | * |
||
19 | * @param array|mixed ...$editors |
||
20 | * @return $this |
||
21 | * @see https://editor.datatables.net/ |
||
22 | * @throws \Exception |
||
23 | */ |
||
24 | public function editors(...$editors) |
||
36 | |||
37 | /** |
||
38 | * Integrate with DataTables Editor. |
||
39 | * |
||
40 | * @param array|Editor $fields |
||
41 | * @return $this |
||
42 | * @see https://editor.datatables.net/ |
||
43 | * @throws \Exception |
||
44 | */ |
||
45 | public function editor($fields) |
||
55 | |||
56 | /** |
||
57 | * @param array|Editor $fields |
||
58 | * @return array|Editor |
||
59 | * @throws \Exception |
||
60 | */ |
||
61 | protected function newEditor($fields) |
||
80 | } |
||
81 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: