Merge pull request #760 from cviebrock/develop
Fix whitespace issues in laravel/form.php
This commit is contained in:
commit
ad14938cb2
|
@ -8,7 +8,7 @@ class Form {
|
|||
* @var array
|
||||
*/
|
||||
public static $labels = array();
|
||||
|
||||
|
||||
/**
|
||||
* The registered custom macros.
|
||||
*
|
||||
|
@ -16,13 +16,13 @@ class Form {
|
|||
*/
|
||||
public static $macros = array();
|
||||
|
||||
/**
|
||||
* Registers a custom macro.
|
||||
*
|
||||
* @param string $name
|
||||
* @param Closure $input
|
||||
* @return void
|
||||
*/
|
||||
/**
|
||||
* Registers a custom macro.
|
||||
*
|
||||
* @param string $name
|
||||
* @param Closure $input
|
||||
* @return void
|
||||
*/
|
||||
public static function macro($name, $macro)
|
||||
{
|
||||
static::$macros[$name] = $macro;
|
||||
|
@ -56,7 +56,7 @@ public static function open($action = null, $method = 'POST', $attributes = arra
|
|||
$method = strtoupper($method);
|
||||
|
||||
$attributes['method'] = static::method($method);
|
||||
|
||||
|
||||
$attributes['action'] = static::action($action, $https);
|
||||
|
||||
// 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
|
|||
* @param array $attributes
|
||||
* @param bool $https
|
||||
* @return string
|
||||
*/
|
||||
*/
|
||||
public static function open_for_files($action = null, $method = 'POST', $attributes = array(), $https = null)
|
||||
{
|
||||
$attributes['enctype'] = 'multipart/form-data';
|
||||
|
@ -143,7 +143,7 @@ public static function open_for_files($action = null, $method = 'POST', $attribu
|
|||
* @param string $method
|
||||
* @param array $attributes
|
||||
* @return string
|
||||
*/
|
||||
*/
|
||||
public static function open_secure_for_files($action = null, $method = 'POST', $attributes = array())
|
||||
{
|
||||
return static::open_for_files($action, $method, $attributes, true);
|
||||
|
@ -181,7 +181,7 @@ public static function token()
|
|||
* @param string $value
|
||||
* @param array $attributes
|
||||
* @return string
|
||||
*/
|
||||
*/
|
||||
public static function label($name, $value, $attributes = array())
|
||||
{
|
||||
static::$labels[] = $name;
|
||||
|
@ -209,7 +209,7 @@ public static function label($name, $value, $attributes = array())
|
|||
* @param mixed $value
|
||||
* @param array $attributes
|
||||
* @return string
|
||||
*/
|
||||
*/
|
||||
public static function input($type, $name, $value = null, $attributes = array())
|
||||
{
|
||||
$name = (isset($attributes['name'])) ? $attributes['name'] : $name;
|
||||
|
@ -240,7 +240,7 @@ public static function text($name, $value = null, $attributes = array())
|
|||
* @param string $name
|
||||
* @param array $attributes
|
||||
* @return string
|
||||
*/
|
||||
*/
|
||||
public static function password($name, $attributes = array())
|
||||
{
|
||||
return static::input('password', $name, null, $attributes);
|
||||
|
@ -266,7 +266,7 @@ public static function hidden($name, $value = null, $attributes = array())
|
|||
* @param string $value
|
||||
* @param array $attributes
|
||||
* @return string
|
||||
*/
|
||||
*/
|
||||
public static function search($name, $value = null, $attributes = array())
|
||||
{
|
||||
return static::input('search', $name, $value, $attributes);
|
||||
|
@ -279,7 +279,7 @@ public static function search($name, $value = null, $attributes = array())
|
|||
* @param string $value
|
||||
* @param array $attributes
|
||||
* @return string
|
||||
*/
|
||||
*/
|
||||
public static function email($name, $value = null, $attributes = array())
|
||||
{
|
||||
return static::input('email', $name, $value, $attributes);
|
||||
|
@ -305,7 +305,7 @@ public static function telephone($name, $value = null, $attributes = array())
|
|||
* @param string $value
|
||||
* @param array $attributes
|
||||
* @return string
|
||||
*/
|
||||
*/
|
||||
public static function url($name, $value = null, $attributes = array())
|
||||
{
|
||||
return static::input('url', $name, $value, $attributes);
|
||||
|
@ -318,12 +318,12 @@ public static function url($name, $value = null, $attributes = array())
|
|||
* @param string $value
|
||||
* @param array $attributes
|
||||
* @return string
|
||||
*/
|
||||
*/
|
||||
public static function number($name, $value = null, $attributes = array())
|
||||
{
|
||||
return static::input('number', $name, $value, $attributes);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Create a HTML date input element.
|
||||
*
|
||||
|
@ -331,7 +331,7 @@ public static function number($name, $value = null, $attributes = array())
|
|||
* @param string $value
|
||||
* @param array $attributes
|
||||
* @return string
|
||||
*/
|
||||
*/
|
||||
public static function date($name, $value = null, $attributes = array())
|
||||
{
|
||||
return static::input('date', $name, $value, $attributes);
|
||||
|
@ -343,7 +343,7 @@ public static function date($name, $value = null, $attributes = array())
|
|||
* @param string $name
|
||||
* @param array $attributes
|
||||
* @return string
|
||||
*/
|
||||
*/
|
||||
public static function file($name, $attributes = array())
|
||||
{
|
||||
return static::input('file', $name, null, $attributes);
|
||||
|
@ -386,18 +386,18 @@ public static function textarea($name, $value = '', $attributes = array())
|
|||
* @param string $selected
|
||||
* @param array $attributes
|
||||
* @return string
|
||||
*/
|
||||
*/
|
||||
public static function select($name, $options = array(), $selected = null, $attributes = array())
|
||||
{
|
||||
$attributes['id'] = static::id($name, $attributes);
|
||||
|
||||
|
||||
$attributes['name'] = $name;
|
||||
|
||||
$html = array();
|
||||
|
||||
foreach ($options as $value => $display)
|
||||
{
|
||||
if (is_array($display))
|
||||
if (is_array($display))
|
||||
{
|
||||
$html[] = static::optgroup($display, $value, $selected);
|
||||
}
|
||||
|
@ -607,12 +607,12 @@ protected static function id($name, $attributes)
|
|||
*/
|
||||
public static function __callStatic($method, $parameters)
|
||||
{
|
||||
if (isset(static::$macros[$method]))
|
||||
{
|
||||
return call_user_func_array(static::$macros[$method], $parameters);
|
||||
}
|
||||
|
||||
throw new \Exception("Method [$method] does not exist.");
|
||||
if (isset(static::$macros[$method]))
|
||||
{
|
||||
return call_user_func_array(static::$macros[$method], $parameters);
|
||||
}
|
||||
|
||||
throw new \Exception("Method [$method] does not exist.");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue