PluginBase

Plugin base class

 class System\Classes\PluginBase
extends Illuminate\Support\ServiceProvider

Properties

public $disabled : bool

Determine if this plugin should be loaded (false) or not (true).

public $elevated : bool

Determine if this plugin should have elevated privileges.

public $require : array

Plugin dependencies

protected $app : Winter\Storm\Foundation\Application

The application instance.

protected $loadedYamlConfiguration : bool

protected $path : string

The absolute path to this plugin's directory, access with getPluginPath()

protected $version : string

The version of this plugin as reported by updates/version.yaml, access with getPluginVersion()

Methods

public boot () : void

Boot method, called right before the request route.

Returns
void

public canReplacePlugin (string $pluginIdentifier, string $version) : bool

Check if the provided plugin & version can be replaced by this plugin

Parameters
Property Description
$pluginIdentifier
string
$version
string
Returns
bool

public checkDependencies (System\Classes\PluginManager $manager) : bool

Verifies the plugin's dependencies are present and enabled

Parameters
Property Description
$manager
System\Classes\PluginManager
Returns
bool

public getPluginIdentifier () : string

Gets the identifier for this plugin

Returns
string

Identifier in format of Author.Plugin

public getPluginPath () : string

Returns the absolute path to this plugin's directory

Returns
string

public getPluginVersion () : string

Gets the current version of the plugin as reported by updates/version.yaml

Returns
string

public getReplaces (boolean $includeConstraints = false) : array

Gets list of plugins replaced by this plugin

Parameters
Property Description
$includeConstraints
boolean

Include version constraints in the results as the array values

Returns
array

['Author.Plugin'] or ['Author.Plugin' => 'self.version']

public pluginDetails () : array

Returns information about this plugin, including plugin name and developer name.

Returns
array

public register () : void

Register method, called when the plugin is first registered.

Returns
void

public registerComponents () : array

Registers any front-end components implemented in this plugin.

Returns
array

public registerConsoleCommand (string $key, string | Closure $command) : void

Registers a new console (artisan) command

Parameters
Property Description
$key
string

The command name

$command
string | Closure

The command class or closure

Returns
void

public registerFormWidgets () : array

Registers any form widgets implemented in this plugin.

The widgets must be returned in the following format:

return [ ['className1' => 'alias'], ['className2' => 'anotherAlias'] ];

Returns
array

public registerListColumnTypes () : array

Registers custom back-end list column types introduced by this plugin.

Returns
array

public registerMailLayouts () : array

Registers any mail layouts implemented by this plugin.

The layouts must be returned in the following format:

return [ 'marketing' => 'acme.blog::layouts.marketing', 'notification' => 'acme.blog::layouts.notification', ];

Returns
array

public registerMailPartials () : array

Registers any mail partials implemented by this plugin.

The partials must be returned in the following format:

return [ 'tracking' => 'acme.blog::partials.tracking', 'promotion' => 'acme.blog::partials.promotion', ];

Returns
array

public registerMailTemplates () : array

Registers any mail templates implemented by this plugin.

The templates must be returned in the following format:

return [ 'acme.blog::mail.welcome', 'acme.blog::mail.forgot_password', ];

Returns
array

public registerMarkupTags () : array

Registers CMS markup tags introduced by this plugin.

Returns
array

public registerNavigation () : array

Registers back-end navigation items for this plugin.

Returns
array

public registerPermissions () : array

Registers any back-end permissions used by this plugin.

Returns
array

public registerQuickActions () : array

Registers back-end quick actions for this plugin.

Returns
array

public registerReportWidgets () : array

Registers any report widgets provided by this plugin.

The widgets must be returned in the following format:

return [ 'className1'=>[ 'label' => 'My widget 1', 'context' => ['context-1', 'context-2'], ], 'className2' => [ 'label' => 'My widget 2', 'context' => 'context-1' ] ];

Returns
array

public registerSchedule (Schedule $schedule) : void

Registers scheduled tasks that are executed on a regular basis.

Parameters
Property Description
$schedule
Schedule
Returns
void

public registerSettings () : array

Registers any back-end configuration links used by this plugin.

Returns
array

protected getConfigurationFromYaml (string | null $exceptionMessage = null) : array | bool

Read configuration from YAML file

Parameters
Property Description
$exceptionMessage
string | null
Returns
array | bool
Copyright © 2024 Winter CMS