1 | <?php |
||
5 | trait HasEditor |
||
6 | { |
||
7 | /** |
||
8 | * Collection of Editors. |
||
9 | * |
||
10 | * @var null|Editor |
||
11 | */ |
||
12 | protected $editors = []; |
||
13 | |||
14 | /** |
||
15 | * Attach multiple editors to builder. |
||
16 | * |
||
17 | * @param mixed ...$editors |
||
18 | * @return $this |
||
19 | * @see https://editor.datatables.net/ |
||
20 | * @throws \Exception |
||
21 | */ |
||
22 | public function editors(...$editors) |
||
30 | |||
31 | /** |
||
32 | * Integrate with DataTables Editor. |
||
33 | * |
||
34 | * @param array|Editor $fields |
||
35 | * @return $this |
||
36 | * @see https://editor.datatables.net/ |
||
37 | * @throws \Exception |
||
38 | */ |
||
39 | public function editor($fields) |
||
49 | |||
50 | /** |
||
51 | * @param array|Editor $fields |
||
52 | * @return array|Editor |
||
53 | * @throws \Exception |
||
54 | */ |
||
55 | protected function newEditor($fields) |
||
74 | } |
||
75 |
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: