PHP Трейт Bootstrap\View\Helper\BootstrapTrait

Показать файл Открыть проект

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

Свойство Тип Описание
$easyIcon boolean Set to false to disable easy icon processing.

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

Метод Описание
addClass ( array $options = [], string | array $class = null, string $key = 'class' ) : array Adds the given class to the element options

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

Метод Описание
_addButtonClasses ( $options ) : The Add classes to options according to values of bootstrap-type and bootstrap-size for button.
_easyIcon ( $callback, $title, $options ) : Whatever This method will the function $callback with the specified argument ($title and $options) after applying a filter on them.
_isAssociativeArray ( $array ) : true Check weither the specified array is associative or not.
_makeIcon ( $title, &$converted = false ) : The Try to convert the specified $text to a bootstrap icon. The $text is converted if it matches a format "i:icon-name".

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

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

Add classes to options according to values of bootstrap-type and bootstrap-size for button.
protected _addButtonClasses ( $options ) : The
$options The initial options with bootstrap-type and/or bootstrat-size values
Результат The new options with class values (btn, and btn-* according to initial options)

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

This method will the function $callback with the specified argument ($title and $options) after applying a filter on them.
protected _easyIcon ( $callback, $title, $options ) : Whatever
$callback The method to call.
$title The first argument ($title).
$options The second argument ($options).
Результат Whatever might be returned by $callback. Note: Currently this method only works for function that take two arguments ($title and $options).

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

Check weither the specified array is associative or not.
protected _isAssociativeArray ( $array ) : true
$array The array to check.
Результат true if the array is associative, false otherwize.

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

Try to convert the specified $text to a bootstrap icon. The $text is converted if it matches a format "i:icon-name".
protected _makeIcon ( $title, &$converted = false ) : The
$title The text to convert.
$converted If specified, will contains true if the text was converted, false otherwize.
Результат The icon element if the conversion was successful, otherwize $text. Note: This function will currently fail if the Html helper associated with the view is not BootstrapHtmlHelper.

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

Adds the given class to the element options
public addClass ( array $options = [], string | array $class = null, string $key = 'class' ) : array
$options array Array options/attributes to add a class to
$class string | array The class name being added.
$key string the key to use for class.
Результат array Array of options with $key set.

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

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

Set to false to disable easy icon processing.
public bool $easyIcon
Результат boolean