Fr3nch13/CakePHP Utilities

Plugin
in package

Plugin is used to load and locate plugins.

It also can retrieve plugin paths and load their bootstrap and routes files.

Tags
link
https://book.cakephp.org/4/en/plugins.html

Table of Contents

Properties

$plugins  : PluginCollection|null
Holds a list of all loaded plugins and their configuration

Methods

classPath()  : string
Returns the filesystem path for plugin's folder containing class files.
configPath()  : string
Returns the filesystem path for plugin's folder containing config files.
getCollection()  : PluginCollection
Get the shared plugin collection.
isLoaded()  : bool
Returns true if the plugin $plugin is already loaded.
loaded()  : array<string|int, string>
Return a list of loaded plugins.
path()  : string
Returns the filesystem path for a plugin
templatePath()  : string
Returns the filesystem path for plugin's folder containing template files.

Properties

$plugins

Holds a list of all loaded plugins and their configuration

protected static PluginCollection|null $plugins

Methods

classPath()

Returns the filesystem path for plugin's folder containing class files.

public static classPath(string $name) : string
Parameters
$name : string

name of the plugin in CamelCase format.

Tags
throws
MissingPluginException

If plugin has not been loaded.

Return values
string —

Path to the plugin folder containing class files.

configPath()

Returns the filesystem path for plugin's folder containing config files.

public static configPath(string $name) : string
Parameters
$name : string

name of the plugin in CamelCase format.

Tags
throws
MissingPluginException

If plugin has not been loaded.

Return values
string —

Path to the plugin folder containing config files.

getCollection()

Get the shared plugin collection.

public static getCollection() : PluginCollection

This method should generally not be used during application runtime as plugins should be set during Application startup.

Return values
PluginCollection

isLoaded()

Returns true if the plugin $plugin is already loaded.

public static isLoaded(string $plugin) : bool
Parameters
$plugin : string

Plugin name.

Tags
since
3.7.0
Return values
bool

loaded()

Return a list of loaded plugins.

public static loaded() : array<string|int, string>
Return values
array<string|int, string> —

A list of plugins that have been loaded

path()

Returns the filesystem path for a plugin

public static path(string $name) : string
Parameters
$name : string

name of the plugin in CamelCase format

Tags
throws
MissingPluginException

If the folder for plugin was not found or plugin has not been loaded.

Return values
string —

path to the plugin folder

templatePath()

Returns the filesystem path for plugin's folder containing template files.

public static templatePath(string $name) : string
Parameters
$name : string

name of the plugin in CamelCase format.

Tags
throws
MissingPluginException

If plugin has not been loaded.

Return values
string —

Path to the plugin folder containing template files.


        
On this page

Search results