PHP Класс Gajus\Dora\Input

Показать файл Открыть проект

Открытые методы

Метод Описание
__construct ( string $name, array $attributes = null, array $properties = null, null | string $template = null )
__toString ( )
deriveName ( $name_path ) : string Convert array selector representation (['baz', 'foo_bar']) to English friendly representation (Bar Foo Bar).
getAttribute ( $name ) : null | string If [id] is undefined at the time of request, Dora will use instance UID.
getNamePath ( ) : array Parse input[name] into an array reprensentation.
getProperty ( string $name ) : mixed
getUid ( )
getValue ( ) : mixed
setProperty ( string $name, mixed $value ) : mixed
toString ( )

Приватные методы

Метод Описание
setAttribute ( string $name, string $value ) Type checking ommission is intentional. PHP does not provide scalar data type hinting. Non-scallar variables will thrown an error when cast to string. Manual validation is an unnecessary overhead.
stringifyAttributes ( ) Generate string representation of the input attributes.

Описание методов

__construct() публичный Метод

public __construct ( string $name, array $attributes = null, array $properties = null, null | string $template = null )
$name string Input name.
$attributes array HTML attributes.
$properties array Input properties, e.g. input name.
$template null | string

__toString() публичный Метод

public __toString ( )

deriveName() публичный статический Метод

If selector name is ends with "_id", then Id is dropped off the name.
public static deriveName ( $name_path ) : string
Результат string

getAttribute() публичный Метод

If [id] is undefined at the time of request, Dora will use instance UID.
public getAttribute ( $name ) : null | string
Результат null | string Attribute value.

getNamePath() публичный Метод

Parse input[name] into an array reprensentation.
public getNamePath ( ) : array
Результат array [name="a[b][c][]"] is represented ['a', 'b', 'c'].

getProperty() публичный Метод

public getProperty ( string $name ) : mixed
$name string Name of the property.
Результат mixed

getUid() публичный Метод

public getUid ( )

getValue() публичный Метод

public getValue ( ) : mixed
Результат mixed

setProperty() публичный Метод

public setProperty ( string $name, mixed $value ) : mixed
$name string Name of the property.
$value mixed
Результат mixed

toString() публичный Метод

public toString ( )