PHP Класс Carbon_Fields\Field\Checkbox_Field

Наследование: extends Field
Показать файл Открыть проект

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

Свойство Тип Описание
$option_value string The value that is saved in the database when this checkbox field is enabled.

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

Метод Описание
get_label ( ) : string Get the field label.
is_required ( ) : boolean Whether this field is required.
set_option_value ( string $value ) Modify the option value.
set_value_from_input ( array $input = null ) Load the field value from an input array based on it's name.
template ( ) Underscore template of the field.
to_json ( boolean $load ) : array Returns an array that holds the field data, suitable for JSON representation.

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

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

Label here is empty because it is displayed in the Underscore template.
public get_label ( ) : string
Результат string Label of the field.

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

A single checkbox field is non-required by design.
public is_required ( ) : boolean
Результат boolean false

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

Modify the option value.
public set_option_value ( string $value )
$value string New value

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

If not enabled, set to empty string for easier data querying.
public set_value_from_input ( array $input = null )
$input array (optional) Array of field names and values. Defaults to $_POST

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

Underscore template of the field.
public template ( )

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

In addition to default data, option value and label are added. This data will be available in the Underscore template and the Backbone Model.
public to_json ( boolean $load ) : array
$load boolean Should the value be loaded from the database or use the value from the current instance.
Результат array

Описание свойств

$option_value защищенное свойство

The value that is saved in the database when this checkbox field is enabled.
protected string $option_value
Результат string