PHP Класс Carbon_Fields\Field\Complex_Field

Allows nested repeaters with multiple field groups to be created.
Наследование: extends Field
Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
$labels

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

Свойство Тип Описание
$fields
$groups
$layout
$values
$values_max
$values_min

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

Метод Описание
add_fields ( ) Add a set/group of fields.
delete ( ) Delete the values of all contained fields.
get_fields ( ) : array Retrieve all groups of fields.
get_group_by_name ( string $group_name ) : Group_Field Retrieve a group by its name.
get_group_names ( ) : array Retrieve the groups of this field.
get_max ( ) : integer Get the maximum number of entries.
get_min ( ) : integer Get the minimum number of entries.
get_values ( ) : array Retrieve the field values.
init ( ) Initialization tasks.
load ( ) Load all groups of fields and their data.
load_values ( ) Load and parse the field data.
load_values_from_array ( array $values ) : array Load and parse a raw set of field data.
load_values_from_db ( ) Load and parse the field data from the database.
process_loaded_values ( array $group_rows ) Parse groups of raw field data into the actual field hierarchy.
save ( ) Save all contained groups of fields.
set_datastore ( Carbon_Fields\Datastore\Datastore_Interface $store ) Set the datastore of this field.
set_header_template ( string | callable $template ) Set the group label Underscore template.
set_layout ( string $layout ) Modify the layout of this field.
set_max ( integer $max ) Set the maximum number of entries.
set_min ( integer $min ) Set the minimum number of entries.
set_prefix ( string $prefix ) Generate and set the field prefix.
set_value_from_input ( array $input = null ) Load the field value from an input array based on it's name.
setup_labels ( array $labels ) Set the field labels.
template ( ) The main Underscore template.
template_group ( ) The Underscore template for the complex field group.
template_group_tab_item ( ) The Underscore template for the group item tab.
to_json ( boolean $load ) : array Returns an array that holds the field data, suitable for JSON representation.

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

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

Add a set/group of fields.
public add_fields ( )

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

Delete the values of all contained fields.
public delete ( )

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

Retrieve all groups of fields.
public get_fields ( ) : array
Результат array $fields

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

Retrieve a group by its name.
public get_group_by_name ( string $group_name ) : Group_Field
$group_name string Group name
Результат Group_Field $group_object Group object

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

Retrieve the groups of this field.
public get_group_names ( ) : array
Результат array

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

Get the maximum number of entries.
public get_max ( ) : integer
Результат integer $max

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

Get the minimum number of entries.
public get_min ( ) : integer
Результат integer $min

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

Retrieve the field values.
public get_values ( ) : array
Результат array

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

Initialization tasks.
public init ( )

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

Load all groups of fields and their data.
public load ( )

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

Load and parse the field data.
public load_values ( )

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

Load and parse a raw set of field data.
public load_values_from_array ( array $values ) : array
$values array Raw data entries
Результат array Processed data entries

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

Load and parse the field data from the database.
public load_values_from_db ( )

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

Parse groups of raw field data into the actual field hierarchy.
public process_loaded_values ( array $group_rows )
$group_rows array Group rows

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

Save all contained groups of fields.
public save ( )

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

Set the datastore of this field.
public set_datastore ( Carbon_Fields\Datastore\Datastore_Interface $store )
$store Carbon_Fields\Datastore\Datastore_Interface

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

Set the group label Underscore template.
public set_header_template ( string | callable $template )
$template string | callable

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

Modify the layout of this field.
public set_layout ( string $layout )
$layout string

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

Set the maximum number of entries.
public set_max ( integer $max )
$max integer

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

Set the minimum number of entries.
public set_min ( integer $min )
$min integer

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

Generate and set the field prefix.
public set_prefix ( string $prefix )
$prefix string

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

Load the field value from an input array based on it's name.
public set_value_from_input ( array $input = null )
$input array (optional) Array of field names and values. Defaults to $_POST

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

Currently supported values: - singular_name - the singular entry label - plural_name - the plural entries label
public setup_labels ( array $labels )
$labels array Labels

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

The main Underscore template.
public template ( )

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

The Underscore template for the complex field group.
public template_group ( )

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

The Underscore template for the group item tab.

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

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

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

protected $fields

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

protected $groups

$labels публичное свойство

public $labels

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

protected $layout

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

protected $values

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

protected $values_max

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

protected $values_min