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.

View source

Public Properties

PropertyDescription
changelogUrlstring, null – The plugin’s changelog URL.
descriptionstring, null – The plugin’s description
developerstring, null – The plugin developer’s name
developerEmailstring, null – The plugin developer’s support email
developerUrlstring, null – The plugin developer’s website URL
documentationUrlstring, null – The plugin’s documentation URL
downloadUrlstring, null – The plugin’s download URL
editionstring – The active edition.
hasCpSectionboolean – Whether the plugin has its own section in the CP
hasCpSettingsboolean – Whether the plugin has a settings page in the CP
isInstalledboolean – Whether the plugin is currently installed.
minVersionRequiredstring – The minimum required version the plugin has to be so it can be updated.
namestring, null – The plugin’s display name
packageNamestring, null – The plugin’s package name
schemaVersionstring, null – The plugin’s schema version number
sourceLanguagestring – The language that the plugin’s messages were written in
t9nCategorystring, null – The translation category that this plugin’s translation messages should use.

changelogUrl

Type
string, null

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-DD

with 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.

View source

description

Type
string, null

The plugin’s description

View source

developer

Type
string, null

The plugin developer’s name

View source

developerEmail

Type
string, null

The plugin developer’s support email

View source

developerUrl

Type
string, null

The plugin developer’s website URL

View source

documentationUrl

Type
string, null

The plugin’s documentation URL

View source

downloadUrl

Type
string, null

The plugin’s download URL

View source

edition

Type
string

The active edition.

View source

hasCpSection

Type
boolean

Whether the plugin has its own section in the CP

View source

hasCpSettings

Type
boolean

Whether the plugin has a settings page in the CP

View source

isInstalled

Type
boolean

Whether the plugin is currently installed. (Will only be false when a plugin is currently being installed.)

View source

minVersionRequired

Type
string

The minimum required version the plugin has to be so it can be updated.

View source

name

Type
string, null

The plugin’s display name

View source

packageName

Type
string, null

The plugin’s package name

View source

schemaVersion

Type
string, null

The plugin’s schema version number

View source

sourceLanguage

Type
string

The language that the plugin’s messages were written in

View source

t9nCategory

Type
string, null

The translation category that this plugin’s translation messages should use. Defaults to the lowercased plugin handle.

View source