PHP 클래스 Collective\Html\FormBuilder

상속: use trait Illuminate\Support\Traits\Macroable
파일 보기 프로젝트 열기: laravelcollective/html 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$csrfToken string The CSRF token used by the form builder.
$html HtmlBuilder The HTML builder instance.
$labels array An array of label names we've created.
$model mixed The current model instance for the form.
$reserved array The reserved form open attributes.
$session Illuminate\Session\SessionInterface The session store implementation.
$skipValueTypes array The types of inputs to not fill values on by default.
$spoofedMethods array The form methods that should be spoofed, in uppercase.
$url Illuminate\Contracts\Routing\UrlGenerator The URL generator instance.
$view Illuminate\Contracts\View\Factory The View factory instance.

공개 메소드들

메소드 설명
__call ( string $method, array $parameters ) : Illuminate\Contracts\View\View | mixed Dynamically handle calls to the class.
__construct ( HtmlBuilder $html, Illuminate\Contracts\Routing\UrlGenerator $url, Illuminate\Contracts\View\Factory $view, string $csrfToken ) Create a new form builder instance.
button ( string $value = null, array $options = [] ) : Illuminate\Support\HtmlString Create a button element.
checkbox ( string $name, mixed $value = 1, boolean $checked = null, array $options = [] ) : Illuminate\Support\HtmlString Create a checkbox input field.
close ( ) : string Close the current form.
color ( string $name, string $value = null, array $options = [] ) : Illuminate\Support\HtmlString Create a color input field.
componentCall ( )
date ( string $name, string $value = null, array $options = [] ) : Illuminate\Support\HtmlString Create a date input field.
datetime ( string $name, string $value = null, array $options = [] ) : Illuminate\Support\HtmlString Create a datetime input field.
datetimeLocal ( string $name, string $value = null, array $options = [] ) : Illuminate\Support\HtmlString Create a datetime-local input field.
email ( string $name, string $value = null, array $options = [] ) : Illuminate\Support\HtmlString Create an e-mail input field.
file ( string $name, array $options = [] ) : Illuminate\Support\HtmlString Create a file input field.
getIdAttribute ( string $name, array $attributes ) : string Get the ID attribute for a field name.
getSelectOption ( string $display, string $value, string $selected ) : Illuminate\Support\HtmlString Get the select option for the given value.
getSessionStore ( ) : Illuminate\Session\SessionInterface Get the session store implementation.
getValueAttribute ( string $name, string $value = null ) : mixed Get the value that should be assigned to the field.
hidden ( string $name, string $value = null, array $options = [] ) : Illuminate\Support\HtmlString Create a hidden input field.
image ( string $url, string $name = null, array $attributes = [] ) : Illuminate\Support\HtmlString Create a HTML image input element.
input ( string $type, string $name, string $value = null, array $options = [] ) : Illuminate\Support\HtmlString Create a form input field.
label ( string $name, string $value = null, array $options = [], boolean $escape_html = true ) : Illuminate\Support\HtmlString Create a form label element.
macroCall ( )
model ( mixed $model, array $options = [] ) : Illuminate\Support\HtmlString Create a new model based form builder.
number ( string $name, string $value = null, array $options = [] ) : Illuminate\Support\HtmlString Create a number input field.
old ( string $name ) : mixed Get a value from the session's old input.
oldInputIsEmpty ( ) : boolean Determine if the old input is empty.
open ( array $options = [] ) : Illuminate\Support\HtmlString Open up a new HTML form.
password ( string $name, array $options = [] ) : Illuminate\Support\HtmlString Create a password input field.
radio ( string $name, mixed $value = null, boolean $checked = null, array $options = [] ) : Illuminate\Support\HtmlString Create a radio button input field.
reset ( string $value, array $attributes = [] ) : Illuminate\Support\HtmlString Create a HTML reset input element.
select ( string $name, array $list = [], string $selected = null, array $options = [] ) : Illuminate\Support\HtmlString Create a select box field.
selectMonth ( string $name, string $selected = null, array $options = [], string $format = '%B' ) : Illuminate\Support\HtmlString Create a select month field.
selectRange ( string $name, string $begin, string $end, string $selected = null, array $options = [] ) : Illuminate\Support\HtmlString Create a select range field.
selectYear ( ) : mixed Create a select year field.
setModel ( mixed $model ) : void Set the model instance on the form builder.
setSessionStore ( Illuminate\Session\SessionInterface $session ) Set the session store implementation.
submit ( string $value = null, array $options = [] ) : Illuminate\Support\HtmlString Create a submit button element.
tel ( string $name, string $value = null, array $options = [] ) : Illuminate\Support\HtmlString Create a tel input field.
text ( string $name, string $value = null, array $options = [] ) : Illuminate\Support\HtmlString Create a text input field.
textarea ( string $name, string $value = null, array $options = [] ) : Illuminate\Support\HtmlString Create a textarea input field.
time ( string $name, string $value = null, array $options = [] ) : Illuminate\Support\HtmlString Create a time input field.
token ( ) : string Generate a hidden field with the current CSRF token.
url ( string $name, string $value = null, array $options = [] ) : Illuminate\Support\HtmlString Create a url input field.

보호된 메소드들

메소드 설명
checkable ( string $type, string $name, mixed $value, boolean $checked, array $options ) : Illuminate\Support\HtmlString Create a checkable input field.
formatLabel ( string $name, string | null $value ) : string Format the label value.
getAction ( array $options ) : string Get the form action from the options.
getAppendage ( string $method ) : string Get the form appendage for the given method.
getCheckboxCheckedState ( string $name, mixed $value, boolean $checked ) : boolean Get the check state for a checkbox input.
getCheckedState ( string $type, string $name, mixed $value, boolean $checked ) : boolean Get the check state for a checkable input.
getControllerAction ( array | string $options ) : string Get the action for an "action" option.
getMethod ( string $method ) : string Parse the form action method.
getModelValueAttribute ( string $name ) : mixed Get the model value that should be assigned to the field.
getRadioCheckedState ( string $name, mixed $value, boolean $checked ) : boolean Get the check state for a radio input.
getRouteAction ( array | string $options ) : string Get the action for a "route" option.
getSelectedValue ( string $value, string $selected ) : null | string Determine if the value is selected.
getUrlAction ( array | string $options ) : string Get the action for a "url" option.
missingOldAndModel ( string $name ) : boolean Determine if old input or model input exists for a key.
option ( string $display, string $value, string $selected ) : Illuminate\Support\HtmlString Create a select element option.
optionGroup ( array $list, string $label, string $selected ) : Illuminate\Support\HtmlString Create an option group form element.
placeholderOption ( $display, $selected ) : Illuminate\Support\HtmlString Create a placeholder select element option.
setQuickTextAreaSize ( array $options ) : array Set the text area size using the quick "size" attribute.
setTextAreaSize ( array $options ) : array Set the text area size on the attributes.
toHtmlString ( $html ) : Illuminate\Support\HtmlString Transform the string to an Html serializable object
transformKey ( string $key ) : mixed Transform key from array to dot syntax.

메소드 상세

__call() 공개 메소드

Dynamically handle calls to the class.
public __call ( string $method, array $parameters ) : Illuminate\Contracts\View\View | mixed
$method string
$parameters array
리턴 Illuminate\Contracts\View\View | mixed

__construct() 공개 메소드

Create a new form builder instance.
public __construct ( HtmlBuilder $html, Illuminate\Contracts\Routing\UrlGenerator $url, Illuminate\Contracts\View\Factory $view, string $csrfToken )
$html HtmlBuilder
$url Illuminate\Contracts\Routing\UrlGenerator
$view Illuminate\Contracts\View\Factory
$csrfToken string

button() 공개 메소드

Create a button element.
public button ( string $value = null, array $options = [] ) : Illuminate\Support\HtmlString
$value string
$options array
리턴 Illuminate\Support\HtmlString

checkable() 보호된 메소드

Create a checkable input field.
protected checkable ( string $type, string $name, mixed $value, boolean $checked, array $options ) : Illuminate\Support\HtmlString
$type string
$name string
$value mixed
$checked boolean
$options array
리턴 Illuminate\Support\HtmlString

checkbox() 공개 메소드

Create a checkbox input field.
public checkbox ( string $name, mixed $value = 1, boolean $checked = null, array $options = [] ) : Illuminate\Support\HtmlString
$name string
$value mixed
$checked boolean
$options array
리턴 Illuminate\Support\HtmlString

close() 공개 메소드

Close the current form.
public close ( ) : string
리턴 string

color() 공개 메소드

Create a color input field.
public color ( string $name, string $value = null, array $options = [] ) : Illuminate\Support\HtmlString
$name string
$value string
$options array
리턴 Illuminate\Support\HtmlString

componentCall() 공개 메소드

public componentCall ( )

date() 공개 메소드

Create a date input field.
public date ( string $name, string $value = null, array $options = [] ) : Illuminate\Support\HtmlString
$name string
$value string
$options array
리턴 Illuminate\Support\HtmlString

datetime() 공개 메소드

Create a datetime input field.
public datetime ( string $name, string $value = null, array $options = [] ) : Illuminate\Support\HtmlString
$name string
$value string
$options array
리턴 Illuminate\Support\HtmlString

datetimeLocal() 공개 메소드

Create a datetime-local input field.
public datetimeLocal ( string $name, string $value = null, array $options = [] ) : Illuminate\Support\HtmlString
$name string
$value string
$options array
리턴 Illuminate\Support\HtmlString

email() 공개 메소드

Create an e-mail input field.
public email ( string $name, string $value = null, array $options = [] ) : Illuminate\Support\HtmlString
$name string
$value string
$options array
리턴 Illuminate\Support\HtmlString

file() 공개 메소드

Create a file input field.
public file ( string $name, array $options = [] ) : Illuminate\Support\HtmlString
$name string
$options array
리턴 Illuminate\Support\HtmlString

formatLabel() 보호된 메소드

Format the label value.
protected formatLabel ( string $name, string | null $value ) : string
$name string
$value string | null
리턴 string

getAction() 보호된 메소드

Get the form action from the options.
protected getAction ( array $options ) : string
$options array
리턴 string

getAppendage() 보호된 메소드

Get the form appendage for the given method.
protected getAppendage ( string $method ) : string
$method string
리턴 string

getCheckboxCheckedState() 보호된 메소드

Get the check state for a checkbox input.
protected getCheckboxCheckedState ( string $name, mixed $value, boolean $checked ) : boolean
$name string
$value mixed
$checked boolean
리턴 boolean

getCheckedState() 보호된 메소드

Get the check state for a checkable input.
protected getCheckedState ( string $type, string $name, mixed $value, boolean $checked ) : boolean
$type string
$name string
$value mixed
$checked boolean
리턴 boolean

getControllerAction() 보호된 메소드

Get the action for an "action" option.
protected getControllerAction ( array | string $options ) : string
$options array | string
리턴 string

getIdAttribute() 공개 메소드

Get the ID attribute for a field name.
public getIdAttribute ( string $name, array $attributes ) : string
$name string
$attributes array
리턴 string

getMethod() 보호된 메소드

Parse the form action method.
protected getMethod ( string $method ) : string
$method string
리턴 string

getModelValueAttribute() 보호된 메소드

Get the model value that should be assigned to the field.
protected getModelValueAttribute ( string $name ) : mixed
$name string
리턴 mixed

getRadioCheckedState() 보호된 메소드

Get the check state for a radio input.
protected getRadioCheckedState ( string $name, mixed $value, boolean $checked ) : boolean
$name string
$value mixed
$checked boolean
리턴 boolean

getRouteAction() 보호된 메소드

Get the action for a "route" option.
protected getRouteAction ( array | string $options ) : string
$options array | string
리턴 string

getSelectOption() 공개 메소드

Get the select option for the given value.
public getSelectOption ( string $display, string $value, string $selected ) : Illuminate\Support\HtmlString
$display string
$value string
$selected string
리턴 Illuminate\Support\HtmlString

getSelectedValue() 보호된 메소드

Determine if the value is selected.
protected getSelectedValue ( string $value, string $selected ) : null | string
$value string
$selected string
리턴 null | string

getSessionStore() 공개 메소드

Get the session store implementation.
public getSessionStore ( ) : Illuminate\Session\SessionInterface
리턴 Illuminate\Session\SessionInterface $session

getUrlAction() 보호된 메소드

Get the action for a "url" option.
protected getUrlAction ( array | string $options ) : string
$options array | string
리턴 string

getValueAttribute() 공개 메소드

Get the value that should be assigned to the field.
public getValueAttribute ( string $name, string $value = null ) : mixed
$name string
$value string
리턴 mixed

hidden() 공개 메소드

Create a hidden input field.
public hidden ( string $name, string $value = null, array $options = [] ) : Illuminate\Support\HtmlString
$name string
$value string
$options array
리턴 Illuminate\Support\HtmlString

image() 공개 메소드

Create a HTML image input element.
public image ( string $url, string $name = null, array $attributes = [] ) : Illuminate\Support\HtmlString
$url string
$name string
$attributes array
리턴 Illuminate\Support\HtmlString

input() 공개 메소드

Create a form input field.
public input ( string $type, string $name, string $value = null, array $options = [] ) : Illuminate\Support\HtmlString
$type string
$name string
$value string
$options array
리턴 Illuminate\Support\HtmlString

label() 공개 메소드

Create a form label element.
public label ( string $name, string $value = null, array $options = [], boolean $escape_html = true ) : Illuminate\Support\HtmlString
$name string
$value string
$options array
$escape_html boolean
리턴 Illuminate\Support\HtmlString

macroCall() 공개 메소드

public macroCall ( )

missingOldAndModel() 보호된 메소드

Determine if old input or model input exists for a key.
protected missingOldAndModel ( string $name ) : boolean
$name string
리턴 boolean

model() 공개 메소드

Create a new model based form builder.
public model ( mixed $model, array $options = [] ) : Illuminate\Support\HtmlString
$model mixed
$options array
리턴 Illuminate\Support\HtmlString

number() 공개 메소드

Create a number input field.
public number ( string $name, string $value = null, array $options = [] ) : Illuminate\Support\HtmlString
$name string
$value string
$options array
리턴 Illuminate\Support\HtmlString

old() 공개 메소드

Get a value from the session's old input.
public old ( string $name ) : mixed
$name string
리턴 mixed

oldInputIsEmpty() 공개 메소드

Determine if the old input is empty.
public oldInputIsEmpty ( ) : boolean
리턴 boolean

open() 공개 메소드

Open up a new HTML form.
public open ( array $options = [] ) : Illuminate\Support\HtmlString
$options array
리턴 Illuminate\Support\HtmlString

option() 보호된 메소드

Create a select element option.
protected option ( string $display, string $value, string $selected ) : Illuminate\Support\HtmlString
$display string
$value string
$selected string
리턴 Illuminate\Support\HtmlString

optionGroup() 보호된 메소드

Create an option group form element.
protected optionGroup ( array $list, string $label, string $selected ) : Illuminate\Support\HtmlString
$list array
$label string
$selected string
리턴 Illuminate\Support\HtmlString

password() 공개 메소드

Create a password input field.
public password ( string $name, array $options = [] ) : Illuminate\Support\HtmlString
$name string
$options array
리턴 Illuminate\Support\HtmlString

placeholderOption() 보호된 메소드

Create a placeholder select element option.
protected placeholderOption ( $display, $selected ) : Illuminate\Support\HtmlString
$display
$selected
리턴 Illuminate\Support\HtmlString

radio() 공개 메소드

Create a radio button input field.
public radio ( string $name, mixed $value = null, boolean $checked = null, array $options = [] ) : Illuminate\Support\HtmlString
$name string
$value mixed
$checked boolean
$options array
리턴 Illuminate\Support\HtmlString

reset() 공개 메소드

Create a HTML reset input element.
public reset ( string $value, array $attributes = [] ) : Illuminate\Support\HtmlString
$value string
$attributes array
리턴 Illuminate\Support\HtmlString

select() 공개 메소드

Create a select box field.
public select ( string $name, array $list = [], string $selected = null, array $options = [] ) : Illuminate\Support\HtmlString
$name string
$list array
$selected string
$options array
리턴 Illuminate\Support\HtmlString

selectMonth() 공개 메소드

Create a select month field.
public selectMonth ( string $name, string $selected = null, array $options = [], string $format = '%B' ) : Illuminate\Support\HtmlString
$name string
$selected string
$options array
$format string
리턴 Illuminate\Support\HtmlString

selectRange() 공개 메소드

Create a select range field.
public selectRange ( string $name, string $begin, string $end, string $selected = null, array $options = [] ) : Illuminate\Support\HtmlString
$name string
$begin string
$end string
$selected string
$options array
리턴 Illuminate\Support\HtmlString

selectYear() 공개 메소드

Create a select year field.
public selectYear ( ) : mixed
리턴 mixed

setModel() 공개 메소드

Set the model instance on the form builder.
public setModel ( mixed $model ) : void
$model mixed
리턴 void

setQuickTextAreaSize() 보호된 메소드

Set the text area size using the quick "size" attribute.
protected setQuickTextAreaSize ( array $options ) : array
$options array
리턴 array

setSessionStore() 공개 메소드

Set the session store implementation.
public setSessionStore ( Illuminate\Session\SessionInterface $session )
$session Illuminate\Session\SessionInterface

setTextAreaSize() 보호된 메소드

Set the text area size on the attributes.
protected setTextAreaSize ( array $options ) : array
$options array
리턴 array

submit() 공개 메소드

Create a submit button element.
public submit ( string $value = null, array $options = [] ) : Illuminate\Support\HtmlString
$value string
$options array
리턴 Illuminate\Support\HtmlString

tel() 공개 메소드

Create a tel input field.
public tel ( string $name, string $value = null, array $options = [] ) : Illuminate\Support\HtmlString
$name string
$value string
$options array
리턴 Illuminate\Support\HtmlString

text() 공개 메소드

Create a text input field.
public text ( string $name, string $value = null, array $options = [] ) : Illuminate\Support\HtmlString
$name string
$value string
$options array
리턴 Illuminate\Support\HtmlString

textarea() 공개 메소드

Create a textarea input field.
public textarea ( string $name, string $value = null, array $options = [] ) : Illuminate\Support\HtmlString
$name string
$value string
$options array
리턴 Illuminate\Support\HtmlString

time() 공개 메소드

Create a time input field.
public time ( string $name, string $value = null, array $options = [] ) : Illuminate\Support\HtmlString
$name string
$value string
$options array
리턴 Illuminate\Support\HtmlString

toHtmlString() 보호된 메소드

Transform the string to an Html serializable object
protected toHtmlString ( $html ) : Illuminate\Support\HtmlString
$html
리턴 Illuminate\Support\HtmlString

token() 공개 메소드

Generate a hidden field with the current CSRF token.
public token ( ) : string
리턴 string

transformKey() 보호된 메소드

Transform key from array to dot syntax.
protected transformKey ( string $key ) : mixed
$key string
리턴 mixed

url() 공개 메소드

Create a url input field.
public url ( string $name, string $value = null, array $options = [] ) : Illuminate\Support\HtmlString
$name string
$value string
$options array
리턴 Illuminate\Support\HtmlString

프로퍼티 상세

$csrfToken 보호되어 있는 프로퍼티

The CSRF token used by the form builder.
protected string $csrfToken
리턴 string

$html 보호되어 있는 프로퍼티

The HTML builder instance.
protected HtmlBuilder,Collective\Html $html
리턴 HtmlBuilder

$labels 보호되어 있는 프로퍼티

An array of label names we've created.
protected array $labels
리턴 array

$model 보호되어 있는 프로퍼티

The current model instance for the form.
protected mixed $model
리턴 mixed

$reserved 보호되어 있는 프로퍼티

The reserved form open attributes.
protected array $reserved
리턴 array

$session 보호되어 있는 프로퍼티

The session store implementation.
protected SessionInterface,Illuminate\Session $session
리턴 Illuminate\Session\SessionInterface

$skipValueTypes 보호되어 있는 프로퍼티

The types of inputs to not fill values on by default.
protected array $skipValueTypes
리턴 array

$spoofedMethods 보호되어 있는 프로퍼티

The form methods that should be spoofed, in uppercase.
protected array $spoofedMethods
리턴 array

$url 보호되어 있는 프로퍼티

The URL generator instance.
protected UrlGenerator,Illuminate\Contracts\Routing $url
리턴 Illuminate\Contracts\Routing\UrlGenerator

$view 보호되어 있는 프로퍼티

The View factory instance.
protected Factory,Illuminate\Contracts\View $view
리턴 Illuminate\Contracts\View\Factory