DirectoryIconSet ​
- Type
- Class
- Namespace
- craft\icons
- Inherits
- craft\icons\DirectoryIconSet » craft\icons\IconSet » yii\base\BaseObject
- Implements
- yii\base\Configurable
- Since
- 5.12.0
DirectoryIconSet is an icon set made up of the SVG files within a directory.
Each file’s name (sans .svg extension) becomes its icon name.
Public Properties ​
| Property | Description |
|---|---|
| handle | string – The icon set’s handle, which prefixes the stored values of icons selected from it. |
| icons | string[] |
| name | string – The icon set’s name, as it should be shown in the control panel. |
| path | string – The path to the directory, which can begin with an alias. |
icons ​
- Type
- string[]
- Default value
null- Access
- Read-only
path ​
- Type
- string
- Default value
null
The path to the directory, which can begin with an alias.
Public Methods ​
| Method | Description |
|---|---|
| __call() | Calls the named method which is not a class method. |
| __construct() | Constructor. |
| __get() | Returns the value of an object property. |
| __isset() | Checks if a property is set, i.e. defined and not null. |
| __set() | Sets value of an object property. |
| __unset() | Sets an object property to null. |
| canGetProperty() | Returns a value indicating whether a property can be read. |
| canSetProperty() | Returns a value indicating whether a property can be set. |
| className() | Returns the fully qualified name of this class. |
| getIcons() | Returns the names of the icons in the set. |
| getKeywords() | Returns search keywords for an icon, in addition to its name. |
| getSvg() | Returns an icon’s SVG markup, or null if the icon doesn’t exist. |
| hasMethod() | Returns a value indicating whether a method is defined. |
| hasProperty() | Returns a value indicating whether a property is defined. |
| init() | Initializes the object. |
getIcons() ​
Returns the names of the icons in the set.
Icon names can’t contain slashes, backslashes, or angle brackets.
Returns ​
string[]
getSvg() ​
Returns an icon’s SVG markup, or null if the icon doesn’t exist.
Arguments ​
$icon(string) – The icon name