PHP Трейт BootstrapUI\View\Helper\OptionsAwareTrait

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

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

Свойство Тип Описание
$buttonClassAliases array A mapping of aliases for button styles.
$buttonClasses array A list of allowed styles for buttons.

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

Метод Описание
applyButtonClasses ( array $data ) : array Contains the logic for applying style classes for buttons.
checkClasses ( array | string $classes, array $options ) : boolean Checks if $classes are part of the $options['class'].
hasAnyClass ( array | string $classes, array $options ) : boolean Checks if $options['class'] contains any one of the class names.
injectClasses ( array | string $classes, array $options ) : array Injects classes into $options['class'] when they don't already exist. If a class is defined in $options['skip'] then it will not be injected. This method removes $options['skip'] before returning.
renameClasses ( array $classMap, array $options ) : array Renames any CSS classes found in the options.

Защищенные методы

Метод Описание
_toClassArray ( mixed $mixed ) : array Normalizes class strings/arrays.

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

_toClassArray() защищенный Метод

Normalizes class strings/arrays.
protected _toClassArray ( mixed $mixed ) : array
$mixed mixed One or more classes.
Результат array Classes as array.

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

Contains the logic for applying style classes for buttons.
public applyButtonClasses ( array $data ) : array
$data array An array of HTML attributes and options.
Результат array An array of HTML attributes and options.

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

Checks if $classes are part of the $options['class'].
public checkClasses ( array | string $classes, array $options ) : boolean
$classes array | string Name of class(es) to check.
$options array An array of HTML attributes and options.
Результат boolean False if one or more class(es) do not exist.

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

Checks if $options['class'] contains any one of the class names.
public hasAnyClass ( array | string $classes, array $options ) : boolean
$classes array | string Name of class(es) to check.
$options array An array of HTML attributes and options.
Результат boolean True if any one of the class names was found.

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

Injects classes into $options['class'] when they don't already exist. If a class is defined in $options['skip'] then it will not be injected. This method removes $options['skip'] before returning.
public injectClasses ( array | string $classes, array $options ) : array
$classes array | string Name of class(es) to inject.
$options array An array of HTML attributes and options.
Результат array An array of HTML attributes and options.

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

Renames any CSS classes found in the options.
public renameClasses ( array $classMap, array $options ) : array
$classMap array Key/Value pair of class(es) to be renamed.
$options array An array of HTML attributes and options.
Результат array An array of HTML attributes and options.

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

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

A mapping of aliases for button styles.
public array $buttonClassAliases
Результат array

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

A list of allowed styles for buttons.
public array $buttonClasses
Результат array