1 | <?php |
||
35 | class Forms |
||
36 | { |
||
37 | private $inputTags = [ |
||
38 | 'text', |
||
39 | 'hidden', |
||
40 | 'search', |
||
41 | 'tel', |
||
42 | 'url', |
||
43 | 'email', |
||
44 | 'password', |
||
45 | 'datetime', |
||
46 | 'date', |
||
47 | 'month', |
||
48 | 'week', |
||
49 | 'time', |
||
50 | 'number', |
||
51 | 'range', |
||
52 | 'color', |
||
53 | 'file', |
||
54 | 'radio', |
||
55 | 'checkbox', |
||
56 | ]; |
||
57 | |||
58 | /** |
||
59 | * @var Inputs |
||
60 | */ |
||
61 | private $inputs; |
||
62 | |||
63 | /** |
||
64 | * @var string |
||
65 | */ |
||
66 | private $default_class = ''; |
||
67 | |||
68 | /** |
||
69 | * @param Inputs $inputs |
||
70 | * @return $this |
||
71 | */ |
||
72 | public function withInputs($inputs) |
||
78 | |||
79 | /** |
||
80 | * sets default class name for input form elements. |
||
81 | * |
||
82 | * @param string $class |
||
83 | * @return $this |
||
84 | */ |
||
85 | public function withClass($class) |
||
91 | |||
92 | /** |
||
93 | * @param Tag $form |
||
94 | * @return mixed |
||
95 | */ |
||
96 | private function setClass($form) |
||
103 | |||
104 | /** |
||
105 | * @param string $type |
||
106 | * @param array $args |
||
107 | * @return $this|string |
||
108 | */ |
||
109 | public function __call($type, $args) |
||
124 | |||
125 | /** |
||
126 | * constructs Input form element object with any type. |
||
127 | * |
||
128 | * @param string $type |
||
129 | * @param string $name |
||
130 | * @param string|null $value |
||
131 | * @return Input |
||
132 | */ |
||
133 | public function input($type, $name, $value = null) |
||
139 | |||
140 | /** |
||
141 | * construct Input[type=radio] form element object. |
||
142 | * |
||
143 | * @param string $name |
||
144 | * @param string $value |
||
145 | * @return Input |
||
146 | */ |
||
147 | public function radio($name, $value) |
||
151 | |||
152 | /** |
||
153 | * construct Input[type=radio] form element object. |
||
154 | * |
||
155 | * @param string $name |
||
156 | * @param string $value |
||
157 | * @return Input |
||
158 | */ |
||
159 | public function checkbox($name, $value) |
||
163 | |||
164 | /** |
||
165 | * @param string $type |
||
166 | * @param string $name |
||
167 | * @param string $value |
||
168 | * @return Input |
||
169 | */ |
||
170 | private function checkedInput($type, $name, $value) |
||
178 | |||
179 | /** |
||
180 | * @param string $label |
||
181 | * @param null|string $for |
||
182 | * @return Tag |
||
183 | */ |
||
184 | public function label($label, $for = null) |
||
188 | |||
189 | /** |
||
190 | * @param null $value |
||
191 | * @return Input |
||
192 | */ |
||
193 | public function submit($value = null) |
||
197 | |||
198 | /** |
||
199 | * @param null $value |
||
200 | * @return Input |
||
201 | */ |
||
202 | public function reset($value = null) |
||
206 | |||
207 | /** |
||
208 | * @param string $name |
||
209 | * @param string|null $value |
||
210 | * @return TextArea |
||
211 | */ |
||
212 | public function textArea($name, $value = null) |
||
218 | |||
219 | /** |
||
220 | * @param string $name |
||
221 | * @param array|Traversable $list |
||
222 | * @param null|string $value |
||
223 | * @return Select |
||
224 | */ |
||
225 | public function select($name, $list, $value = null) |
||
231 | |||
232 | /** |
||
233 | * @param string $name |
||
234 | * @param array|Traversable $list |
||
235 | * @param null|string $value |
||
236 | * @return InputList |
||
237 | */ |
||
238 | public function checkList($name, $list, $value = null) |
||
243 | |||
244 | /** |
||
245 | * @param string $name |
||
246 | * @param array|Traversable $list |
||
247 | * @param null|string $value |
||
248 | * @return InputList |
||
249 | */ |
||
250 | public function radioList($name, $list, $value = null) |
||
255 | |||
256 | /** |
||
257 | * @return Tags\Form |
||
258 | */ |
||
259 | public function open() |
||
263 | |||
264 | /** |
||
265 | * @return string |
||
266 | */ |
||
267 | public function close() |
||
271 | |||
272 | /** |
||
273 | * @param string $arg |
||
274 | * @return Tag |
||
275 | */ |
||
276 | public function formGroup($arg = '') |
||
287 | |||
288 | /** |
||
289 | * @param array $attribute |
||
290 | * @return Attribute |
||
291 | */ |
||
292 | public function newAttribute(array $attribute = []) |
||
296 | } |
||
297 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.