PHP Trait BootstrapUI\View\Helper\OptionsAwareTrait

Afficher le fichier Open project: friendsofcake/bootstrap-ui Trait Usage Examples

Méthodes publiques

Свойство Type Description
$buttonClassAliases array A mapping of aliases for button styles.
$buttonClasses array A list of allowed styles for buttons.

Méthodes publiques

Méthode Description
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.

Méthodes protégées

Méthode Description
_toClassArray ( mixed $mixed ) : array Normalizes class strings/arrays.

Method Details

_toClassArray() protected méthode

Normalizes class strings/arrays.
protected _toClassArray ( mixed $mixed ) : array
$mixed mixed One or more classes.
Résultat array Classes as array.

applyButtonClasses() public méthode

Contains the logic for applying style classes for buttons.
public applyButtonClasses ( array $data ) : array
$data array An array of HTML attributes and options.
Résultat array An array of HTML attributes and options.

checkClasses() public méthode

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.
Résultat boolean False if one or more class(es) do not exist.

hasAnyClass() public méthode

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.
Résultat boolean True if any one of the class names was found.

injectClasses() public méthode

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.
Résultat array An array of HTML attributes and options.

renameClasses() public méthode

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.
Résultat array An array of HTML attributes and options.

Property Details

$buttonClassAliases public_oe property

A mapping of aliases for button styles.
public array $buttonClassAliases
Résultat array

$buttonClasses public_oe property

A list of allowed styles for buttons.
public array $buttonClasses
Résultat array