PHP Class Bootstrapper\Form

See also: http://twitter.github.com/bootstrap/
Author: Patrick Talmadge - ([email protected])
Author: Maxime Fabre - ([email protected])
Author: Patrick Rose - ([email protected])
Author: Marvin Schröder - ([email protected])
Inheritance: extends Illuminate\Support\Facades\Facade
Show file Open project: patricktalmadge/bootstrapper Class Usage Examples

Public Methods

Method Description
color ( string $name, null $value = null, array $attributes = [] ) : string Creates a color element
date ( string $name, null $value = null, array $attributes = [] ) : string Creates a date input
datetime ( string $name, null $value = null, array $attributes = [] ) : string Creates a datetime form element
datetimelocal ( string $name, null $value = null, array $attributes = [] ) : string Creates a datetime local element
email ( string $name, string | null $value = null, array $attributes = [] ) : string
error ( string $label, string $input, array $attributes = [] ) : string Creates an error validation block
feedback ( string $label, string $input, string $icon, array $attributes = [] ) : string Creates a feedback block with an icon
getFormattedError ( string $name ) : string Get the formatted errors for the form element with the given name.
hasErrors ( string $name ) : boolean Determine whether the form element with the given name has any validation errors.
help ( string $helpText, array $attributes = [] ) : string Creates a help block
horizontal ( array $attributes = [] ) : string Opens a horizontal form
horizontalModel ( mixed $model, array $attributes = [] ) : string Opens a horizontal form with a given model
inline ( array $attributes = [] ) : string Opens an inline form
inlineModel ( mixed $model, array $attributes = [] ) : string Opens a inline form with a given model
label ( string $name, string | null $value = null, array $options = [], $escape_html = true ) : string
month ( string $name, null $value = null, array $attributes = [] ) : string Creates a month input
number ( string $name, null $value = null, array $attributes = [] ) : string Creates a number form element
password ( string $name, array $attributes = [] ) : string
search ( string $name, null $value = null, array $attributes = [] ) : string Creates a search element
select ( string $name, array $list = [], null $selected = null, array $attributes = [] ) : string
submit ( string | null $value = null, array $options = [] ) : string
success ( string $label, string $input, array $attributes = [] ) : string Creates a success validation block
tel ( string $name, null $value = null, array $attributes = [] ) : string Creates a tel element
text ( string $name, string | null $value = null, array $attributes = [] ) : string
textarea ( string $name, string | null $value = null, array $attributes = [] ) : string
time ( string $name, null $value = null, array $attributes = [] ) : string Creates a time form element
url ( string $name, null $value = null, array $attributes = [] ) : string Creates a url form element
validation ( string $type, string $label, string $input, array $attributes = [] ) : string Creates a validation block
warning ( string $label, string $input, array $attributes = [] ) : string Creates a warning validation block
week ( string $name, null $value = null, array $attributes = [] ) : string Creates a week form element

Method Details

color() public method

Creates a color element
public color ( string $name, null $value = null, array $attributes = [] ) : string
$name string The name of the element
$value null
$attributes array
return string

date() public method

Creates a date input
public date ( string $name, null $value = null, array $attributes = [] ) : string
$name string The name of the element
$value null
$attributes array
return string

datetime() public method

Creates a datetime form element
See also: Illuminate\FormBuilder\input()
public datetime ( string $name, null $value = null, array $attributes = [] ) : string
$name string The name of the element
$value null The value
$attributes array The attributes
return string

datetimelocal() public method

Creates a datetime local element
See also: Illuminate\FormBuilder\input()
public datetimelocal ( string $name, null $value = null, array $attributes = [] ) : string
$name string The name of the element
$value null
$attributes array
return string

email() public method

public email ( string $name, string | null $value = null, array $attributes = [] ) : string
$name string The name of the email input
$value string | null The default value of the input
$attributes array The attributes of the email input
return string

error() public method

Creates an error validation block
See also: Bootstrapper\\Form::validation()
public error ( string $label, string $input, array $attributes = [] ) : string
$label string The label
$input string The input
$attributes array The attributes of the validation block
return string

feedback() public method

Creates a feedback block with an icon
public feedback ( string $label, string $input, string $icon, array $attributes = [] ) : string
$label string The label
$input string The input
$icon string The icon
$attributes array The attributes of the block
return string

getFormattedError() public method

Get the formatted errors for the form element with the given name.
public getFormattedError ( string $name ) : string
$name string
return string

hasErrors() public method

Determine whether the form element with the given name has any validation errors.
public hasErrors ( string $name ) : boolean
$name string
return boolean

help() public method

Creates a help block
public help ( string $helpText, array $attributes = [] ) : string
$helpText string The help text
$attributes array
return string

horizontal() public method

Opens a horizontal form
public horizontal ( array $attributes = [] ) : string
$attributes array
return string

horizontalModel() public method

Opens a horizontal form with a given model
See also: Bootstrapper\Form::horizontal()
See also: Illuminate\Html::model()
public horizontalModel ( mixed $model, array $attributes = [] ) : string
$model mixed
$attributes array
return string

inline() public method

Opens an inline form
public inline ( array $attributes = [] ) : string
$attributes array The attributes of the array
return string

inlineModel() public method

Opens a inline form with a given model
See also: Bootstrapper\Form::inline()
See also: Illuminate\Html::model()
public inlineModel ( mixed $model, array $attributes = [] ) : string
$model mixed
$attributes array
return string

label() public method

public label ( string $name, string | null $value = null, array $options = [], $escape_html = true ) : string
$name string The name of the object this label will be attached to
$value string | null The text of the label
$options array The options of the label
return string

month() public method

Creates a month input
public month ( string $name, null $value = null, array $attributes = [] ) : string
$name string The name of the element
$value null
$attributes array
return string

number() public method

Creates a number form element
public number ( string $name, null $value = null, array $attributes = [] ) : string
$name string The name of the element
$value null
$attributes array
return string

password() public method

public password ( string $name, array $attributes = [] ) : string
$name string The name of the password input
$attributes array The attributes of the input
return string

select() public method

public select ( string $name, array $list = [], null $selected = null, array $attributes = [] ) : string
$name string
$list array
$selected null
$attributes array
return string

submit() public method

public submit ( string | null $value = null, array $options = [] ) : string
$value string | null The value of the submit button
$options array The options
return string

success() public method

Creates a success validation block
See also: Bootstrapper\\Form::validation()
public success ( string $label, string $input, array $attributes = [] ) : string
$label string The label
$input string The input
$attributes array The attributes of the validation block
return string

tel() public method

Creates a tel element
public tel ( string $name, null $value = null, array $attributes = [] ) : string
$name string The name of the element
$value null
$attributes array
return string

text() public method

public text ( string $name, string | null $value = null, array $attributes = [] ) : string
$name string The name of the text input
$value string | null The default value
$attributes array The attributes of the input
return string

textarea() public method

public textarea ( string $name, string | null $value = null, array $attributes = [] ) : string
$name string The name of the text area
$value string | null The default value
$attributes array The attributes of the text area
return string

time() public method

Creates a time form element
public time ( string $name, null $value = null, array $attributes = [] ) : string
$name string The name of the element
$value null
$attributes array
return string

url() public method

Creates a url form element
public url ( string $name, null $value = null, array $attributes = [] ) : string
$name string The name of the element
$value null
$attributes array
return string

validation() public method

Creates a validation block
public validation ( string $type, string $label, string $input, array $attributes = [] ) : string
$type string The type of validation
$label string The label
$input string The input
$attributes array The attributes of the validation block
return string

warning() public method

Creates a warning validation block
See also: Bootstrapper\\Form::validation()
public warning ( string $label, string $input, array $attributes = [] ) : string
$label string The label
$input string The input
$attributes array The attributes of the validation block
return string

week() public method

Creates a week form element
public week ( string $name, null $value = null, array $attributes = [] ) : string
$name string The name of the element
$value null
$attributes array
return string