Skip to content
PHP Ecosystem
Explore

IconSet

API reference › Bootstrap 6 › IconSet

final classyii2\extensions\bootstrap6\IconSet
Extendsyii\base\BaseObject
Implementsyii\base\Configurable
Sourcesrc/IconSet.php

Provides the default SVG icons rendered by the widgets and lets applications replace them through the DI container.

Widgets resolve the set with Yii::createObject(IconSet::class), so a container.definitions entry for this class replaces any icon globally. Every property holds its bundled default until the configuration overrides it.

See also: https://developer.mozilla.org/en-US/docs/Web/SVG/Element/svg.

PropertyTypeDescriptionDefined by
$accordionChevronstring|StringableChevron rendered after each Accordion item label; receives the accordion-icon class.IconSet
$comboboxCaretstring|StringableCaret rendered inside the Combobox toggle; receives the combobox-caret class.IconSet
$menuItemCheckstring|StringableCheck mark rendered inside each Combobox item; receives the menu-item-check class.IconSet
MethodDescriptionDefined by
__construct()Builds the bundled defaults before the configuration replaces any of them.IconSet
__call()Calls the named method which is not a class method.yii\base\BaseObject
__get()Returns the value of an object property.yii\base\BaseObject
__isset()Checks if a property is set, i.e. defined and not null.yii\base\BaseObject
__set()Sets value of an object property.yii\base\BaseObject
__unset()Sets an object property to null.yii\base\BaseObject
canGetProperty()Returns a value indicating whether a property can be read.yii\base\BaseObject
canSetProperty()Returns a value indicating whether a property can be set.yii\base\BaseObject
className() staticReturns the fully qualified name of this class.yii\base\BaseObject
hasMethod()Returns a value indicating whether a method is defined.yii\base\BaseObject
hasProperty()Returns a value indicating whether a property is defined.yii\base\BaseObject
init()Initializes the object.yii\base\BaseObject
render() staticReturns the markup of an icon with its structural CSS class.IconSet
public function __construct(array<string, mixed> $config = [])

Builds the bundled defaults before the configuration replaces any of them.

Parameters

ParameterTypeDescription
$configarray<string, mixed>Name-value pairs that override the default icons.
public static function render(string|Stringable $icon, string $class): string

Returns the markup of an icon with its structural CSS class.

A \UIAwesome\Html\Svg\Svg instance receives $class appended to its own classes (html-svg skips a class it already carries). Any other value is cast to string verbatim, so plain markup and other Stringable objects must already carry the class.

Parameters

ParameterTypeDescription
$iconstring|StringableIcon to render.
$classstringStructural CSS class the Bootstrap stylesheet targets, for example accordion-icon.

Returns

string