IconProvider
in
IconProviders are used to render an icon for a specific icon library.
The [[render()]] function of a IconProvider should ideally support all features of the [[\humhub\modules\ui\icon\widgets\Icon]] widget and furthermore map all icon names available in [[\humhub\modules\ui\icon\widgets\Icon::$names]].
Tags
Table of Contents
Methods
- getId() : string
- getNames() : array<string|int, string>
- Return all supported icon names.
- render() : mixed
- Use as follows:
- renderList() : mixed
- Renders a icon list:
Methods
getId()
public
getId() : string
Return values
string —unique factory id used in the lib
option of icons
getNames()
Return all supported icon names.
public
getNames() : array<string|int, string>
Return values
array<string|int, string>render()
Use as follows:
public
render(mixed $icon[, mixed $options = [] ]) : mixed
IconFactory::render('task');
IconFactory::render('task', ['fixedWith' => true]);
IconFactory::render(['name' => 'task', 'fixedWith' => true]);
IconFactory::render(new Icon(['name' => 'task', 'fixedWith' => true]));
Note: If the provider does not support a specific icon name or feature it should return null.
Parameters
- $icon : mixed
-
string|Icon|[]|null either an icon name, icon instance or icon array definition
- $options : mixed = []
renderList()
Renders a icon list:
public
renderList(mixed $listDefinition) : mixed
Note: If the provider does not support this feature, it should return null.
Parameters
- $listDefinition : mixed