PHP 클래스 Carbon_Fields\Field\Checkbox_Field

상속: extends Field
파일 보기 프로젝트 열기: htmlburger/carbon-fields

보호된 프로퍼티들

프로퍼티 타입 설명
$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