PluginTrait ​
- Type
- Trait
- Namespace
- craft\base
- Implemented by
- craft\base\Plugin
- Since
- 3.0.0
PluginTrait implements the common methods and properties for plugin classes.
Public Properties ​
| Property | Description |
|---|---|
| changelogUrl | string, null – The plugin’s changelog URL. |
| description | string, null – The plugin’s description |
| developer | string, null – The plugin developer’s name |
| developerEmail | string, null – The plugin developer’s support email |
| developerUrl | string, null – The plugin developer’s website URL |
| documentationUrl | string, null – The plugin’s documentation URL |
| downloadUrl | string, null – The plugin’s download URL |
| edition | string – The active edition. |
| hasCpSection | boolean – Whether the plugin has its own section in the control panel |
| hasCpSettings | boolean – Whether the plugin has a settings page in the control panel |
| isInstalled | boolean – Whether the plugin is currently installed. |
| minVersionRequired | string – The minimum required version the plugin has to be so it can be updated. |
| name | string, null – The plugin’s display name |
| packageName | string, null – The plugin’s package name |
| schemaVersion | string – The plugin’s schema version number |
| sourceLanguage | string – The language that the plugin’s messages were written in |
| t9nCategory | string, null – The translation category that this plugin’s translation messages should use. |
changelogUrl ​
The plugin’s changelog URL.
The URL should begin with https:// and point to a plain text Markdown-formatted changelog. Version headers must follow the general format:
## X.Y.Z - YYYY-MM-DDwith the following possible deviations:
- other text can come before the version number, like the plugin’s name
- a 4th version number is allowed (e.g.
1.2.3.4) - pre-release versions are allowed (e.g.
1.0.0-alpha.1) - the version can start with
v(e.g.v1.2.3) - the version can be hyperlinked (e.g.
[1.2.3]) - dates can use dots as separators, rather than hyphens (e.g.
YYYY.MM.DD) - a
[CRITICAL]flag can be appended after the date to indicate a critical release
More notes:
- Releases should be listed in descending order (newest on top). Craft will stop parsing the changelog as soon as it hits a version that is older than or equal to the installed version.
- Any content that does not follow a version header line will be ignored.
- For consistency and clarity, release notes should follow keepachangelog.com, but it’s not enforced.
- Release notes can contain notes using the format
> {note} Some note.{warning}and{tip}are also supported.
description ​
The plugin’s description
developer ​
The plugin developer’s name
developerEmail ​
The plugin developer’s support email
developerUrl ​
The plugin developer’s website URL
documentationUrl ​
The plugin’s documentation URL
downloadUrl ​
The plugin’s download URL
edition ​
- Type
- string
- Default value
'standard'
The active edition.
hasCpSection ​
- Type
- boolean
- Default value
false
Whether the plugin has its own section in the control panel
hasCpSettings ​
- Type
- boolean
- Default value
false
Whether the plugin has a settings page in the control panel
isInstalled ​
- Type
- boolean
- Default value
false
Whether the plugin is currently installed. (Will only be false when a plugin is currently being installed.)
minVersionRequired ​
- Type
- string
- Default value
''
The minimum required version the plugin has to be so it can be updated.
name ​
The plugin’s display name
packageName ​
The plugin’s package name
schemaVersion ​
- Type
- string
- Default value
'1.0.0'
The plugin’s schema version number
sourceLanguage ​
- Type
- string
- Default value
'en-US'
The language that the plugin’s messages were written in
t9nCategory ​
The translation category that this plugin’s translation messages should use. Defaults to the lowercased plugin handle.