PHP Класс Carbon_Fields\Field\Group_Field

Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
$fields array Group fields.
$group_id string Unique group identificator. Generated randomly.
$label string Group label, used during rendering.
$label_template string Group label underscore template.
$name string Sanitized group name.
$registered_field_names array List of registered unique field names

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

Метод Описание
__construct ( string $name, string $label, array $fields ) Create a group field with the specified name and label.
add_fields ( array $fields ) Add a group of fields.
get_field_names ( ) : array Return the names of all fields.
get_fields ( ) : array Fields attribute getter.
get_group_id ( ) : string Group ID attribute getter.
get_label ( ) : string Label attribute getter.
get_label_template ( ) : string Set the Underscore label template.
get_name ( ) : string Return the group name.
set_datastore ( Carbon_Fields\Datastore\Datastore_Interface $store ) Assign a DataStore instance for all group fields.
set_label ( string $label ) Set the group label.
set_label_template ( string $template ) Set the Underscore label template.
set_name ( string $name ) Set the group name.
set_prefix ( string $prefix ) Set a prefix for all group fields.
template_label ( ) Print the label Underscore template.
to_json ( boolean $load ) : array Returns an array that holds the field data, suitable for JSON representation.
verify_unique_field_name ( string $name ) Perform checks whether there is a field registered with the name $name.

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

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

Create a group field with the specified name and label.
public __construct ( string $name, string $label, array $fields )
$name string
$label string
$fields array

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

Add a group of fields.
public add_fields ( array $fields )
$fields array

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

Return the names of all fields.
public get_field_names ( ) : array
Результат array

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

Fields attribute getter.
public get_fields ( ) : array
Результат array

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

Group ID attribute getter.
public get_group_id ( ) : string
Результат string

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

Label attribute getter.
public get_label ( ) : string
Результат string

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

Set the Underscore label template.
public get_label_template ( ) : string
Результат string

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

Return the group name.
public get_name ( ) : string
Результат string

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

Assign a DataStore instance for all group fields.
public set_datastore ( Carbon_Fields\Datastore\Datastore_Interface $store )
$store Carbon_Fields\Datastore\Datastore_Interface

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

Set the group label.
public set_label ( string $label )
$label string If null, the label will be generated from the group name

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

Set the Underscore label template.
public set_label_template ( string $template )
$template string

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

Set the group name.
public set_name ( string $name )
$name string Group name, either sanitized or not

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

Set a prefix for all group fields.
public set_prefix ( string $prefix )
$prefix string

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

Print the label Underscore template.
public template_label ( )

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

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

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

If not, the field name is recorded.
public verify_unique_field_name ( string $name )
$name string

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

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

Group fields.
protected array $fields
Результат array

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

Unique group identificator. Generated randomly.
protected string $group_id
Результат string

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

Group label, used during rendering.
protected string $label
Результат string

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

Group label underscore template.
protected string $label_template
Результат string

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

Sanitized group name.
protected string $name
Результат string

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

List of registered unique field names
См. также: verify_unique_field_name()
protected array $registered_field_names
Результат array