PHP Класс Former\Traits\Field

Наследование: extends Former\Traits\FormerObject, implements Former\Interfaces\FieldInterface
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$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