PHP 클래스 Former\Traits\Field

상속: extends Former\Traits\FormerObject, implements Former\Interfaces\FieldInterface
파일 보기 프로젝트 열기: anahkiasen/former 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$app Illuminate\Container\Container The IoC Container
$bind string The field's bind destination
$element string The field's default element
$form Former\Former\Form The Form instance
$group Former\Form\Group The field's group
$isSelfClosing boolean Whether the Field is self-closing or not
$label string A label for the field (if not using Bootstrap)

공개 메소드들

메소드 설명
__call ( string $method, $parameters ) Redirect calls to the group if necessary
__construct ( Illuminate\Container\Container $app, string $type, $name, $label, $value, $attributes ) Set up a Field instance
__toString ( ) : string Prints out the field
bind ( $destination ) Change the field's bind destination
forceValue ( string $value ) Set the Field value no matter what
getLabel ( ) : string Get the field's labels
getRules ( ) : array Get the rules applied to the current field
isButton ( ) : boolean Check if the field is a button
isCheckable ( ) : boolean Check if field is a checkbox or a radio
isRequired ( ) : boolean Whether the current field is required or not
isUnwrappable ( ) : boolean Check if a field is unwrappable (no label)
label ( string $text, array $attributes = [] ) : Field Adds a label to the group/field
name ( string $name ) Change the field's name
rule ( string $rule ) Apply a Live Validation rule by chaining
rules ( $rules ) Apply multiple rules passed as a string.
value ( string $value ) Classic setting of attribute, won't overwrite any populate() attempt
wrapAndRender ( ) : string Prints out the field, wrapped in its group

보호된 메소드들

메소드 설명
currentFramework ( ) : Former\Traits\Framework Get the current framework instance

비공개 메소드들

메소드 설명
automaticLabels ( string $name, string $label ) : false | null Ponders a label and a field name, and tries to get the best out of it
repopulate ( $fallback = null ) Use values stored in Former to populate the current field

메소드 상세

__call() 공개 메소드

Redirect calls to the group if necessary
public __call ( string $method, $parameters )
$method string

__construct() 공개 메소드

Set up a Field instance
public __construct ( Illuminate\Container\Container $app, string $type, $name, $label, $value, $attributes )
$app Illuminate\Container\Container
$type string A field type

__toString() 공개 메소드

Prints out the field
public __toString ( ) : string
리턴 string

bind() 공개 메소드

Change the field's bind destination
public bind ( $destination )
$destination

currentFramework() 보호된 메소드

Get the current framework instance
protected currentFramework ( ) : Former\Traits\Framework
리턴 Former\Traits\Framework

forceValue() 공개 메소드

Set the Field value no matter what
public forceValue ( string $value )
$value string A new value

getLabel() 공개 메소드

Get the field's labels
public getLabel ( ) : string
리턴 string

getRules() 공개 메소드

Get the rules applied to the current field
public getRules ( ) : array
리턴 array An array of rules

isButton() 공개 메소드

Check if the field is a button
public isButton ( ) : boolean
리턴 boolean

isCheckable() 공개 메소드

Check if field is a checkbox or a radio
public isCheckable ( ) : boolean
리턴 boolean

isRequired() 공개 메소드

Whether the current field is required or not
public isRequired ( ) : boolean
리턴 boolean

isUnwrappable() 공개 메소드

Check if a field is unwrappable (no label)
public isUnwrappable ( ) : boolean
리턴 boolean

label() 공개 메소드

Adds a label to the group/field
public label ( string $text, array $attributes = [] ) : Field
$text string A label
$attributes array The label's attributes
리턴 Field A field

name() 공개 메소드

Change the field's name
public name ( string $name )
$name string The new name

rule() 공개 메소드

Apply a Live Validation rule by chaining
public rule ( string $rule )
$rule string The rule

rules() 공개 메소드

Apply multiple rules passed as a string.
public rules ( $rules )
$rules

value() 공개 메소드

Classic setting of attribute, won't overwrite any populate() attempt
public value ( string $value )
$value string A new value

wrapAndRender() 공개 메소드

Prints out the field, wrapped in its group
public wrapAndRender ( ) : string
리턴 string

프로퍼티 상세

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

The IoC Container
protected Container,Illuminate\Container $app
리턴 Illuminate\Container\Container

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

The field's bind destination
protected string $bind
리턴 string

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

The field's default element
protected string $element
리턴 string

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

The Form instance
protected Form,Former\Former $form
리턴 Former\Former\Form

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

The field's group
protected Group,Former\Form $group
리턴 Former\Form\Group

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

Whether the Field is self-closing or not
protected bool $isSelfClosing
리턴 boolean

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

A label for the field (if not using Bootstrap)
protected string $label
리턴 string