PHP Trait Bootstrap\View\Helper\BootstrapTrait

Datei anzeigen Open project: holt59/cakephp3-bootstrap3-helpers

Public Properties

Property Type Description
$easyIcon boolean Set to false to disable easy icon processing.

Public Methods

Method Description
addClass ( array $options = [], string | array $class = null, string $key = 'class' ) : array Adds the given class to the element options

Protected Methods

Method Description
_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".

Method Details

_addButtonClasses() protected method

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
return The new options with class values (btn, and btn-* according to initial options)

_easyIcon() protected method

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).
return Whatever might be returned by $callback. Note: Currently this method only works for function that take two arguments ($title and $options).

_isAssociativeArray() protected method

Check weither the specified array is associative or not.
protected _isAssociativeArray ( $array ) : true
$array The array to check.
return true if the array is associative, false otherwize.

_makeIcon() protected method

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.
return 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() public method

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.
return array Array of options with $key set.

Property Details

$easyIcon public_oe property

Set to false to disable easy icon processing.
public bool $easyIcon
return boolean