1 | <?php namespace Kris\LaravelFormBuilder; |
||
7 | class FormBuilder |
||
8 | { |
||
9 | |||
10 | /** |
||
11 | * @var Container |
||
12 | */ |
||
13 | protected $container; |
||
14 | |||
15 | /** |
||
16 | * @var FormHelper |
||
17 | */ |
||
18 | protected $formHelper; |
||
19 | |||
20 | /** |
||
21 | * @var EventDispatcher |
||
22 | */ |
||
23 | protected $eventDispatcher; |
||
24 | |||
25 | /** |
||
26 | * @param Container $container |
||
27 | * @var string |
||
28 | */ |
||
29 | protected $plainFormClass = Form::class; |
||
30 | |||
31 | /** |
||
32 | * @param Container $container |
||
33 | * @param FormHelper $formHelper |
||
34 | */ |
||
35 | 107 | public function __construct(Container $container, FormHelper $formHelper, EventDispatcher $eventDispatcher) |
|
41 | |||
42 | /** |
||
43 | * @param $formClass |
||
44 | * @param $options |
||
45 | * @param $data |
||
46 | * @return Form |
||
47 | */ |
||
48 | 17 | public function create($formClass, array $options = [], array $data = []) |
|
74 | |||
75 | /** |
||
76 | * @param $items |
||
77 | * @param array $options |
||
78 | * @param array $data |
||
79 | * @return mixed |
||
80 | */ |
||
81 | public function createByArray($items, array $options = [], array $data = []) |
||
99 | |||
100 | /** |
||
101 | * @param $form |
||
102 | * @param $items |
||
103 | */ |
||
104 | public function buildFormByArray($form, $items) |
||
121 | |||
122 | /** |
||
123 | * Get the namespace from the config |
||
124 | * |
||
125 | * @return string |
||
126 | */ |
||
127 | 17 | protected function getNamespaceFromConfig() |
|
137 | |||
138 | /** |
||
139 | * Get instance of the empty form which can be modified |
||
140 | * Get the plain form class. |
||
141 | * |
||
142 | * @return string |
||
143 | */ |
||
144 | public function getFormClass() { |
||
147 | |||
148 | /** |
||
149 | * Set the plain form class. |
||
150 | * |
||
151 | * @param string $class |
||
152 | */ |
||
153 | public function setFormClass($class) { |
||
161 | |||
162 | /** |
||
163 | * Get instance of the empty form which can be modified. |
||
164 | * |
||
165 | * @param array $options |
||
166 | * @param array $data |
||
167 | * @return Form |
||
168 | */ |
||
169 | 107 | public function plain(array $options = [], array $data = []) |
|
185 | } |
||
186 |