KMP PHP API Reference

EasyIconTrait

A trait that provides easy icon processing.

Table of Contents

Properties

$easyIcon  : bool
Set to false to disable easy icon processing.

Methods

_easyIconOption()  : array<string|int, mixed>
Remove the `easyIcon` option from the given array and return it together with the array.
_injectIcon()  : string
Inject icon into the given string.
_makeIcon()  : string
Try to convert the specified string to a bootstrap icon. The string is converted if it matches a format `i:icon-name` (leading and trailing spaces or ignored) and if easy-icon is activated.

Properties

$easyIcon

Set to false to disable easy icon processing.

public bool $easyIcon = true

Methods

_easyIconOption()

Remove the `easyIcon` option from the given array and return it together with the array.

protected _easyIconOption(array<string|int, mixed> $options) : array<string|int, mixed>
Parameters
$options : array<string|int, mixed>

Array of options from which the easy-icon option should be extracted.

Return values
array<string|int, mixed>

An array containing the options and the easy-icon option.

_injectIcon()

Inject icon into the given string.

protected _injectIcon(string $title, bool $easyIcon) : string
Parameters
$title : string

Input string where icon should be injected following the easy-icon process.

$easyIcon : bool

Boolean indicating if the easy-icon process should be applied.

Return values
string

_makeIcon()

Try to convert the specified string to a bootstrap icon. The string is converted if it matches a format `i:icon-name` (leading and trailing spaces or ignored) and if easy-icon is activated.

protected _makeIcon(string $text[, bool &$converted = false ]) : string

Note: This function will currently fail if the Html helper associated with the view is not BootstrapHtmlHelper.

Parameters
$text : string

The string to convert.

$converted : bool = false

If specified, will contains true if the text was converted, false otherwize.

Return values
string

The text after conversion.


        
On this page

Search results