1 | <?php |
||
8 | class Row implements Renderable |
||
9 | { |
||
10 | /** |
||
11 | * Callback for add field to current row.s. |
||
12 | * |
||
13 | * @var \Closure |
||
14 | */ |
||
15 | protected $callback; |
||
16 | |||
17 | /** |
||
18 | * Parent form. |
||
19 | * |
||
20 | * @var Form |
||
21 | */ |
||
22 | protected $form; |
||
23 | |||
24 | /** |
||
25 | * Fields in this row. |
||
26 | * |
||
27 | * @var array |
||
28 | */ |
||
29 | protected $fields = []; |
||
30 | |||
31 | /** |
||
32 | * Default field width for appended field. |
||
33 | * |
||
34 | * @var int |
||
35 | */ |
||
36 | protected $defaultFieldWidth = 12; |
||
37 | |||
38 | /** |
||
39 | * Row constructor. |
||
40 | * |
||
41 | * @param \Closure $callback |
||
42 | * @param Form $form |
||
43 | */ |
||
44 | public function __construct(\Closure $callback, Form $form) |
||
52 | |||
53 | /** |
||
54 | * Get fields of this row. |
||
55 | * |
||
56 | * @return array |
||
57 | */ |
||
58 | public function getFields() |
||
62 | |||
63 | /** |
||
64 | * Set width for a incomming field. |
||
65 | * |
||
66 | * @param int $width |
||
67 | * |
||
68 | * @return $this |
||
69 | */ |
||
70 | public function width($width = 12) |
||
76 | |||
77 | /** |
||
78 | * Render the row. |
||
79 | * |
||
80 | * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View |
||
81 | */ |
||
82 | public function render() |
||
86 | |||
87 | /** |
||
88 | * Add field. |
||
89 | * |
||
90 | * @param string $method |
||
91 | * @param array $arguments |
||
92 | * |
||
93 | * @return Field|void |
||
94 | */ |
||
95 | public function __call($method, $arguments) |
||
108 | } |
||
109 |