UtilityInterface
- Type
- Interface
- Namespace
- craft\base
- Extends
- craft\base\ComponentInterface
- Implemented by
- craft\base\Utility, craft\utilities\AssetIndexes, craft\utilities\ClearCaches, craft\utilities\DbBackup, craft\utilities\DeprecationErrors, craft\utilities\FindAndReplace, craft\utilities\Migrations, craft\utilities\PhpInfo, craft\utilities\ProjectConfig, craft\utilities\QueueManager, craft\utilities\SystemMessages, craft\utilities\SystemReport, craft\utilities\Updates, craft\utilities\Upgrade
- Since
- 3.0.0
UtilityInterface defines the common interface to be implemented by utility classes.
View source (opens new window)
# Public Methods
Method | Description |
---|---|
badgeCount() | Returns the number that should be shown in the utility’s nav item badge. |
contentHtml() | Returns the utility's content HTML. |
displayName() | Returns the display name of this class. |
extraFields() (opens new window) | Returns the list of additional fields that can be returned by toArray() (opens new window) in addition to those listed in fields() (opens new window). |
fields() (opens new window) | Returns the list of fields that should be returned by default by toArray() (opens new window) when no specific fields are specified. |
footerHtml() | Returns the utility’s footer HTML. |
iconPath() | Returns the path to the utility’s SVG icon. |
id() | Returns the utility’s unique identifier. |
instance() (opens new window) | Returns static class instance, which can be used to obtain meta information. |
isSelectable() | Returns whether the component should be selectable in component Type selects. |
toArray() (opens new window) | Converts the object into an array. |
toolbarHtml() | Returns the utility’s toolbar HTML. |
# badgeCount()
Returns the number that should be shown in the utility’s nav item badge.
If 0
is returned, no badge will be shown
View source (opens new window)
Returns
# contentHtml()
Returns the utility's content HTML.
View source (opens new window)
Returns
# footerHtml()
- Since
- 3.4.0
Returns the utility’s footer HTML.
View source (opens new window)
Returns
# iconPath()
Returns the path to the utility’s SVG icon.
View source (opens new window)
Returns
string (opens new window), null (opens new window)
# id()
Returns the utility’s unique identifier.
The ID should be in kebab-case
, as it will be visible in the URL (admin/utilities/the-handle
).
View source (opens new window)
Returns
# toolbarHtml()
- Since
- 3.4.0
Returns the utility’s toolbar HTML.
View source (opens new window)