FormBuilder
        
        Form builder
    
    
 class Winter\Storm\Html\FormBuilderTraits
| Trait | Description | 
|---|---|
| Illuminate\Support\Traits\Macroable | 
Properties
            
            
            
                protected
            
            
            $csrfToken
            
                :
                                                                                                                string
                                                                                                |
                                                                            null
                                                                                                
                        = null
                    
                            
        
        
        The CSRF token used by the form builder.
protected $html : Winter\Storm\Html\HtmlBuilder
The HTML builder instance.
            
            
            
                protected
            
            
            $labels
            
                :
                                                            array
                                                                        
                        = []
                    
                            
        
        
        An array of label names we've created.
            
            
            
                protected
            
            
            $model
            
                :
                                                                                                                object
                                                                                                |
                                                                            array
                                                                                                |
                                                                            null
                                                                                                
                        = null
                    
                            
        
        
        The current model instance for the form.
            
            
            
                protected
            
            
            $reserved
            
                :
                                                            array
                                                                        
                        = ["method","url","route","action","files","request","model","sessionKey"]
                    
                            
        
        
        The reserved form open attributes.
            
            
            
                protected
            
            
            $reservedAjax
            
                :
                                                            array
                                                                        
                        = ["request","success","error","complete","confirm","redirect","update","data","validate","flash"]
                    
                            
        
        
        The reserved form AJAX attributes.
            
            
            
                protected
            
            
            $session
            
                :
                                                                                                                Illuminate\Session\Store
                                                                                                |
                                                                            null
                                                                                                
                        = null
                    
                            
        
        
        The session store implementation.
            
            
            
                protected
            
            
            $sessionKey
            
                :
                                                                                                                string
                                                                                                |
                                                                            null
                                                                                                
                        = null
                    
                            
        
        
        The session key used by the form builder.
            
            
            
                protected
            
            
            $skipValueTypes
            
                :
                                                            array
                                                                        
                        = ["file","password","checkbox","radio"]
                    
                            
        
        
        The types of inputs to not fill values on by default.
            
            
            
                protected
            
            
            $spoofedMethods
            
                :
                                                            array
                                                                        
                        = ["DELETE","PATCH","PUT"]
                    
                            
        
        
        The form methods that should be spoofed, in uppercase.
protected $url : Illuminate\Routing\UrlGenerator
The URL generator instance.
Methods
            
            
            
                public
            
                        
            __construct (Winter\Storm\Html\HtmlBuilder $html, Illuminate\Routing\UrlGenerator $url, $csrfToken = null, $sessionKey = null)
                    
        
        Create a new form builder instance.
| Property | Type | Description | 
|---|---|---|
| $html | Winter\Storm\Html\HtmlBuilder | Winter\Storm\Html\HtmlBuilder | 
| $url | Illuminate\Routing\UrlGenerator | Illuminate\Routing\UrlGenerator | 
| $csrfToken | mixed | mixed | 
| $sessionKey | mixed | mixed | 
            
            
            
                public
            
                        
            ajax (string | array $handler, array $options = [])
                            : string
                    
        
        Helper for opening a form used for an AJAX call.
| Property | Type | Description | 
|---|---|---|
| $handler | string | array | string | array | 
| $options | array | array | 
            
            
            
                public
            
                        
            button (string $value = null, array $options = [])
                            : string
                    
        
        Create a button element.
| Property | Type | Description | 
|---|---|---|
| $value | string | string | 
| $options | array | array | 
            
            
            
                public
            
                        
            checkbox (string $name, string $value = "1", boolean $checked = false, array $options = [])
                            : string
                    
        
        Create a checkbox input field.
| Property | Type | Description | 
|---|---|---|
| $name | string | string | 
| $value | string | string | 
| $checked | boolean | boolean | 
| $options | array | array | 
public close () : string
Close the current form.
            
            
            
                public
            
                        
            email (string $name, $value = null, array $options = [])
                            : string
                    
        
        Create an email input field.
| Property | Type | Description | 
|---|---|---|
| $name | string | string | 
| $value | mixed | mixed | 
| $options | array | array | 
            
            
            
                public
            
                        
            file (string $name, array $options = [])
                            : string
                    
        
        Create a file input field.
| Property | Type | Description | 
|---|---|---|
| $name | string | string | 
| $options | array | array | 
public getIdAttribute (string $name, array $attributes) : string | null
Get the ID attribute for a field name.
| Property | Type | Description | 
|---|---|---|
| $name | string | string | 
| $attributes | array | array | 
            
            
            
                public
            
                        
            getSelectOption (string | array $display, string $value, $selected = null)
                            : string
                    
        
        Get the select option for the given value.
| Property | Type | Description | 
|---|---|---|
| $display | string | array | string | array | 
| $value | string | string | 
| $selected | mixed | mixed | 
public getSessionKey () : string | null
Returns the active session key, used fr deferred bindings.
public getSessionStore () : Illuminate\Session\Store
Get the session store implementation.
$session
            
            
            
                public
            
                        
            getValueAttribute (string | null $name = null, string | array | int | null $value = null)
                            : string | array | null
                    
        
        Get the value that should be assigned to the field.
| Property | Type | Description | 
|---|---|---|
| $name | string | null | string | null | 
| $value | string | array | int | null | string | array | int | null | 
            
            
            
                public
            
                        
            hidden (string $name, $value = null, array $options = [])
                            : string
                    
        
        Create a hidden input field.
| Property | Type | Description | 
|---|---|---|
| $name | string | string | 
| $value | mixed | mixed | 
| $options | array | array | 
            
            
            
                public
            
                        
            image (string $url, string $name = null, array $attributes = [])
                            : string
                    
        
        Create a HTML image input element.
| Property | Type | Description | 
|---|---|---|
| $url | string | string | 
| $name | string | string | 
| $attributes | array | array | 
            
            
            
                public
            
                        
            input (string $type, string | null $name = null, string | null $value = null, array $options = [])
                            : string
                    
        
        Create a form input field.
| Property | Type | Description | 
|---|---|---|
| $type | string | string | 
| $name | string | null | string | null | 
| $value | string | null | string | null | 
| $options | array | array | 
            
            
            
                public
            
                        
            label (string $name, string $value = "", array $options = [])
                            : string
                    
        
        Create a form label element.
| Property | Type | Description | 
|---|---|---|
| $name | string | string | 
| $value | string | string | 
| $options | array | array | 
            
            
            
                public
            
                        
            model (object | array $model, array $options = [])
                            : string
                    
        
        Create a new model based form builder.
| Property | Type | Description | 
|---|---|---|
| $model | object | array | object | array | 
| $options | array | array | 
public old (string $name) : string | array | null
Get a value from the session's old input.
| Property | Type | Description | 
|---|---|---|
| $name | string | string | 
public oldInputIsEmpty () : bool
Determine if the old input is empty.
            
            
            
                public
            
                        
            open (array $options = [])
                            : string
                    
        
        Open up a new HTML form and includes a session key.
| Property | Type | Description | 
|---|---|---|
| $options | array | array | 
            
            
            
                public
            
                        
            password (string $name, array $options = [])
                            : string
                    
        
        Create a password input field.
| Property | Type | Description | 
|---|---|---|
| $name | string | string | 
| $options | array | array | 
            
            
            
                public
            
                        
            radio (string $name, $value = null, boolean $checked = false, array $options = [])
                            : string
                    
        
        Create a radio button input field.
| Property | Type | Description | 
|---|---|---|
| $name | string | string | 
| $value | mixed | mixed | 
| $checked | boolean | boolean | 
| $options | array | array | 
            
            
            
                public
            
                        
            reset (string $value, array $attributes = [])
                            : string
                    
        
        Create a HTML reset input element.
| Property | Type | Description | 
|---|---|---|
| $value | string | string | 
| $attributes | array | array | 
            
            
            
                public
            
                        
            select (string $name, array $list = [], $selected = null, array $options = [])
                            : string
                    
        
        Create a select box field with empty option support.
| Property | Type | Description | 
|---|---|---|
| $name | string | string | 
| $list | array | array | 
| $selected | mixed | mixed | 
| $options | array | array | 
            
            
            
                public
            
                        
            selectMonth (string $name, $selected = null, array $options = [], string $format = "%B")
                            : string
                    
        
        Create a select month field.
| Property | Type | Description | 
|---|---|---|
| $name | string | string | 
| $selected | mixed | mixed | 
| $options | array | array | 
| $format | string | string | 
            
            
            
                public
            
                        
            selectRange (string $name, string | integer | float $begin, string | integer | float $end, $selected = null, array $options = [])
                            : string
                    
        
        Create a select range field.
| Property | Type | Description | 
|---|---|---|
| $name | string | string | 
| $begin | string | integer | float | string | integer | float | 
| $end | string | integer | float | string | integer | float | 
| $selected | mixed | mixed | 
| $options | array | array | 
            
            
            
                public
            
                        
            selectYear (string $name, integer $begin = 1900, $end = null, $selected = null, array $options = [])
                            : string
                    
        
        Create a select year field.
| Property | Type | Description | 
|---|---|---|
| $name | string | string | 
| $begin | integer | integer | 
| $end | mixed | mixed | 
| $selected | mixed | mixed | 
| $options | array | array | 
            
            
            
                public
            
                        
            sessionKey ($sessionKey = null)
                            : string
                    
        
        Returns a hidden HTML input, supplying the session key value.
| Property | Type | Description | 
|---|---|---|
| $sessionKey | mixed | mixed | 
public setModel (object | array | null $model) : void
Set the model instance on the form builder.
| Property | Type | Description | 
|---|---|---|
| $model | object | array | null | object | array | null | 
public setSessionStore (Illuminate\Session\Store $session) : $this
Set the session store implementation.
| Property | Type | Description | 
|---|---|---|
| $session | Illuminate\Session\Store | Illuminate\Session\Store | 
            
            
            
                public
            
                        
            submit (string $value = null, array $options = [])
                            : string
                    
        
        Create a submit button element.
| Property | Type | Description | 
|---|---|---|
| $value | string | string | 
| $options | array | array | 
            
            
            
                public
            
                        
            text (string $name, $value = null, array $options = [])
                            : string
                    
        
        Create a text input field.
| Property | Type | Description | 
|---|---|---|
| $name | string | string | 
| $value | mixed | mixed | 
| $options | array | array | 
            
            
            
                public
            
                        
            textarea (string $name, $value = null, array $options = [])
                            : string
                    
        
        Create a textarea input field.
| Property | Type | Description | 
|---|---|---|
| $name | string | string | 
| $value | mixed | mixed | 
| $options | array | array | 
public token () : string
Generate a hidden field with the current CSRF token.
            
            
            
                public
            
                        
            url (string $name, $value = null, array $options = [])
                            : string
                    
        
        Create a URL input field.
| Property | Type | Description | 
|---|---|---|
| $name | string | string | 
| $value | mixed | mixed | 
| $options | array | array | 
            
            
            
                public
            
                        
            value (string $name, string $value = null)
                            : string
                    
        
        Helper for getting form values. Tries to find the old value, then uses a postback/get value, then looks at the form model values.
| Property | Type | Description | 
|---|---|---|
| $name | string | string | 
| $value | string | string | 
            
            
            
                protected
            
                        
            checkable (string $type, string $name, string $value, boolean $checked = false, array $options = [])
                            : string
                    
        
        Create a checkable input field.
| Property | Type | Description | 
|---|---|---|
| $type | string | string | 
| $name | string | string | 
| $value | string | string | 
| $checked | boolean | boolean | 
| $options | array | array | 
            
            
            
                protected
            
                        
            formatLabel (string $name, string $value = "")
                            : string
                    
        
        Format the label value.
| Property | Type | Description | 
|---|---|---|
| $name | string | string | 
| $value | string | string | 
protected getAction (array $options) : string
Get the form action from the options.
| Property | Type | Description | 
|---|---|---|
| $options | array | array | 
protected getAppendage (string $method) : string
Get the form appendage for the given method.
| Property | Type | Description | 
|---|---|---|
| $method | string | string | 
protected getCheckboxCheckedState (string $name, mixed $value, bool $checked) : bool
Get the check state for a checkbox input.
| Property | Type | Description | 
|---|---|---|
| $name | string | string | 
| $value | mixed | mixed | 
| $checked | bool | bool | 
protected getCheckedState (string $type, string $name, mixed $value, bool $checked) : bool
Get the check state for a checkable input.
| Property | Type | Description | 
|---|---|---|
| $type | string | string | 
| $name | string | string | 
| $value | mixed | mixed | 
| $checked | bool | bool | 
protected getControllerAction (array | string $options) : string
Get the action for an "action" option.
| Property | Type | Description | 
|---|---|---|
| $options | array | string | array | string | 
protected getMethod (string $method) : string
Parse the form action method.
| Property | Type | Description | 
|---|---|---|
| $method | string | string | 
protected getModelValueAttribute (string $name) : string | array | null
Get the model value that should be assigned to the field.
| Property | Type | Description | 
|---|---|---|
| $name | string | string | 
protected getRadioCheckedState (string $name, mixed $value, bool $checked) : bool
Get the check state for a radio input.
| Property | Type | Description | 
|---|---|---|
| $name | string | string | 
| $value | mixed | mixed | 
| $checked | bool | bool | 
protected getRouteAction (array | string $options) : string
Get the action for a "route" option.
| Property | Type | Description | 
|---|---|---|
| $options | array | string | array | string | 
protected getSelectedValue (string $value, string | array | null $selected) : string | null
Determine if the value is selected.
| Property | Type | Description | 
|---|---|---|
| $value | string | string | 
| $selected | string | array | null | string | array | null | 
protected getUrlAction (array | string $options) : string
Get the action for a "url" option.
| Property | Type | Description | 
|---|---|---|
| $options | array | string | array | string | 
protected missingOldAndModel (string $name) : bool
Determine if old input or model input exists for a key.
| Property | Type | Description | 
|---|---|---|
| $name | string | string | 
            
            
            
                protected
            
                        
            option (string $display, string $value, $selected = null)
                            : string
                    
        
        Create a select element option.
| Property | Type | Description | 
|---|---|---|
| $display | string | string | 
| $value | string | string | 
| $selected | mixed | mixed | 
            
            
            
                protected
            
                        
            optionGroup (array $list, string $label, $selected = null)
                            : string
                    
        
        Create an option group form element.
| Property | Type | Description | 
|---|---|---|
| $list | array | array | 
| $label | string | string | 
| $selected | mixed | mixed | 
            
            
            
                protected
            
                        
            requestHandler ($name = null)
                            : string
                    
        
        Returns a hidden HTML input, supplying the session key value.
| Property | Type | Description | 
|---|---|---|
| $name | mixed | mixed | 
protected setQuickTextAreaSize (array $options) : array
Set the text area size using the quick "size" attribute.
| Property | Type | Description | 
|---|---|---|
| $options | array | array | 
protected setTextAreaSize (array $options) : array
Set the text area size on the attributes.
| Property | Type | Description | 
|---|---|---|
| $options | array | array | 
protected transformKey (string $key) : string
Transform key from array to dot syntax.
| Property | Type | Description | 
|---|---|---|
| $key | string | string |