@@ -8,21 +8,21 @@ class Form {
8
8
* @var array
9
9
*/
10
10
public static $ labels = array ();
11
-
11
+
12
12
/**
13
13
* The registered custom macros.
14
14
*
15
15
* @var array
16
16
*/
17
17
public static $ macros = array ();
18
18
19
- /**
20
- * Registers a custom macro.
21
- *
22
- * @param string $name
23
- * @param Closure $input
24
- * @return void
25
- */
19
+ /**
20
+ * Registers a custom macro.
21
+ *
22
+ * @param string $name
23
+ * @param Closure $input
24
+ * @return void
25
+ */
26
26
public static function macro ($ name , $ macro )
27
27
{
28
28
static ::$ macros [$ name ] = $ macro ;
@@ -56,7 +56,7 @@ public static function open($action = null, $method = 'POST', $attributes = arra
56
56
$ method = strtoupper ($ method );
57
57
58
58
$ attributes ['method ' ] = static ::method ($ method );
59
-
59
+
60
60
$ attributes ['action ' ] = static ::action ($ action , $ https );
61
61
62
62
// If a character encoding has not been specified in the attributes, we will
@@ -128,7 +128,7 @@ public static function open_secure($action = null, $method = 'POST', $attributes
128
128
* @param array $attributes
129
129
* @param bool $https
130
130
* @return string
131
- */
131
+ */
132
132
public static function open_for_files ($ action = null , $ method = 'POST ' , $ attributes = array (), $ https = null )
133
133
{
134
134
$ attributes ['enctype ' ] = 'multipart/form-data ' ;
@@ -143,7 +143,7 @@ public static function open_for_files($action = null, $method = 'POST', $attribu
143
143
* @param string $method
144
144
* @param array $attributes
145
145
* @return string
146
- */
146
+ */
147
147
public static function open_secure_for_files ($ action = null , $ method = 'POST ' , $ attributes = array ())
148
148
{
149
149
return static ::open_for_files ($ action , $ method , $ attributes , true );
@@ -181,7 +181,7 @@ public static function token()
181
181
* @param string $value
182
182
* @param array $attributes
183
183
* @return string
184
- */
184
+ */
185
185
public static function label ($ name , $ value , $ attributes = array ())
186
186
{
187
187
static ::$ labels [] = $ name ;
@@ -209,7 +209,7 @@ public static function label($name, $value, $attributes = array())
209
209
* @param mixed $value
210
210
* @param array $attributes
211
211
* @return string
212
- */
212
+ */
213
213
public static function input ($ type , $ name , $ value = null , $ attributes = array ())
214
214
{
215
215
$ name = (isset ($ attributes ['name ' ])) ? $ attributes ['name ' ] : $ name ;
@@ -240,7 +240,7 @@ public static function text($name, $value = null, $attributes = array())
240
240
* @param string $name
241
241
* @param array $attributes
242
242
* @return string
243
- */
243
+ */
244
244
public static function password ($ name , $ attributes = array ())
245
245
{
246
246
return static ::input ('password ' , $ name , null , $ attributes );
@@ -266,7 +266,7 @@ public static function hidden($name, $value = null, $attributes = array())
266
266
* @param string $value
267
267
* @param array $attributes
268
268
* @return string
269
- */
269
+ */
270
270
public static function search ($ name , $ value = null , $ attributes = array ())
271
271
{
272
272
return static ::input ('search ' , $ name , $ value , $ attributes );
@@ -279,7 +279,7 @@ public static function search($name, $value = null, $attributes = array())
279
279
* @param string $value
280
280
* @param array $attributes
281
281
* @return string
282
- */
282
+ */
283
283
public static function email ($ name , $ value = null , $ attributes = array ())
284
284
{
285
285
return static ::input ('email ' , $ name , $ value , $ attributes );
@@ -305,7 +305,7 @@ public static function telephone($name, $value = null, $attributes = array())
305
305
* @param string $value
306
306
* @param array $attributes
307
307
* @return string
308
- */
308
+ */
309
309
public static function url ($ name , $ value = null , $ attributes = array ())
310
310
{
311
311
return static ::input ('url ' , $ name , $ value , $ attributes );
@@ -318,20 +318,20 @@ public static function url($name, $value = null, $attributes = array())
318
318
* @param string $value
319
319
* @param array $attributes
320
320
* @return string
321
- */
321
+ */
322
322
public static function number ($ name , $ value = null , $ attributes = array ())
323
323
{
324
324
return static ::input ('number ' , $ name , $ value , $ attributes );
325
325
}
326
-
326
+
327
327
/**
328
328
* Create a HTML date input element.
329
329
*
330
330
* @param string $name
331
331
* @param string $value
332
332
* @param array $attributes
333
333
* @return string
334
- */
334
+ */
335
335
public static function date ($ name , $ value = null , $ attributes = array ())
336
336
{
337
337
return static ::input ('date ' , $ name , $ value , $ attributes );
@@ -343,7 +343,7 @@ public static function date($name, $value = null, $attributes = array())
343
343
* @param string $name
344
344
* @param array $attributes
345
345
* @return string
346
- */
346
+ */
347
347
public static function file ($ name , $ attributes = array ())
348
348
{
349
349
return static ::input ('file ' , $ name , null , $ attributes );
@@ -386,18 +386,18 @@ public static function textarea($name, $value = '', $attributes = array())
386
386
* @param string $selected
387
387
* @param array $attributes
388
388
* @return string
389
- */
389
+ */
390
390
public static function select ($ name , $ options = array (), $ selected = null , $ attributes = array ())
391
391
{
392
392
$ attributes ['id ' ] = static ::id ($ name , $ attributes );
393
-
393
+
394
394
$ attributes ['name ' ] = $ name ;
395
395
396
396
$ html = array ();
397
397
398
398
foreach ($ options as $ value => $ display )
399
399
{
400
- if (is_array ($ display ))
400
+ if (is_array ($ display ))
401
401
{
402
402
$ html [] = static ::optgroup ($ display , $ value , $ selected );
403
403
}
@@ -607,12 +607,12 @@ protected static function id($name, $attributes)
607
607
*/
608
608
public static function __callStatic ($ method , $ parameters )
609
609
{
610
- if (isset (static ::$ macros [$ method ]))
611
- {
612
- return call_user_func_array (static ::$ macros [$ method ], $ parameters );
613
- }
614
-
615
- throw new \Exception ("Method [ $ method] does not exist. " );
610
+ if (isset (static ::$ macros [$ method ]))
611
+ {
612
+ return call_user_func_array (static ::$ macros [$ method ], $ parameters );
613
+ }
614
+
615
+ throw new \Exception ("Method [ $ method] does not exist. " );
616
616
}
617
617
618
618
}
0 commit comments