Presenter Output

This section will show you how to use the decorated value provided by the \Anomaly\CheckboxesFieldType\CheckboxesFieldTypePresenter class.

CheckboxesFieldTypePresenter::count()

The count method returns the number of selected options.

Returns: integer
Example
$decorated->example->count();
Twig
{{ decorated.example.count() }}

CheckboxesFieldTypePresenter::total()

The total method returns the total number of available options.

Returns: integer
Example
$decorated->example->total();
Twig
{{ decorated.example.total() }}

CheckboxesFieldTypePresenter::keys()

The keys method returns an array of selected value keys.

Returns: array
Example
$decorated->example->keys();
Twig
{{ decorated.example.keys() }}

CheckboxesFieldTypePresenter::values()

The values method returns an array of selected values.

Returns: array
Example
$decorated->example->values();
Twig
{{ decorated.example.values() }}

CheckboxesFieldTypePresenter::selections()

The selections method returns an associated array of selected key => value pairs.

Returns: array
Example
$decorated->example->selections();
Twig
{{ decorated.example.selections() }}