CakePHP
  • Documentation
    • Book
    • API
    • Videos
    • Reporting Security Issues
    • Privacy Policy
    • Logos & Trademarks
  • Business Solutions
  • Swag
  • Road Trip
  • Team
  • Community
    • Community
    • Get Involved
    • Issues (Github)
    • Bakery
    • Featured Resources
    • Training
    • Meetups
    • My CakePHP
    • CakeFest
    • Newsletter
    • Linkedin
    • YouTube
    • Facebook
    • Twitter
    • Mastodon
    • Help & Support
    • Forum
    • Stack Overflow
    • IRC
    • Slack
    • Paid Support
CakePHP

C CakePHP 4.6 Strawberry API

  • Project:
    • CakePHP
      • CakePHP
      • Authentication
      • Authorization
      • Chronos
      • Elastic Search
      • Queue
  • Version:
    • 4.6
      • 5.2
      • 5.1
      • 5.0
      • 4.6
      • 4.5
      • 4.4
      • 4.3
      • 4.2
      • 4.1
      • 4.0
      • 3.10
      • 3.9
      • 3.8
      • 3.7
      • 3.6
      • 3.5
      • 3.4
      • 3.3
      • 3.2
      • 3.1
      • 3.0
      • 2.10
      • 2.9
      • 2.8
      • 2.7
      • 2.6
      • 2.5
      • 2.4
      • 2.3
      • 2.2
      • 2.1
      • 2.0
      • 1.3
      • 1.2

Namespaces

  • Global
  • Cake
    • Auth
    • Cache
    • Collection
    • Command
    • Console
    • Controller
    • Core
      • Configure
      • Exception
      • Retry
      • TestSuite
    • Database
    • Datasource
    • Error
    • Event
    • Filesystem
    • Form
    • Http
    • I18n
    • Log
    • Mailer
    • Network
    • ORM
    • Routing
    • Shell
    • TestSuite
    • Utility
    • Validation
    • View

Class Plugin

Plugin is used to load and locate plugins.

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

Namespace: Cake\Core
Link: https://book.cakephp.org/4/en/plugins.html

Property Summary

  • $plugins protected static
    Cake\Core\PluginCollection|null

    Holds a list of all loaded plugins and their configuration

Method Summary

  • classPath() public static

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

  • configPath() public static

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

  • getCollection() public static

    Get the shared plugin collection.

  • isLoaded() public static

    Returns true if the plugin $plugin is already loaded.

  • loaded() public static

    Return a list of loaded plugins.

  • path() public static

    Returns the filesystem path for a plugin

  • templatePath() public static

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

Method Detail

classPath() ¶ public static

classPath(string $name): string

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

Parameters
string $name

name of the plugin in CamelCase format.

Returns
string

Path to the plugin folder containing class files.

Throws
Cake\Core\Exception\MissingPluginException
If plugin has not been loaded.

configPath() ¶ public static

configPath(string $name): string

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

Parameters
string $name

name of the plugin in CamelCase format.

Returns
string

Path to the plugin folder containing config files.

Throws
Cake\Core\Exception\MissingPluginException
If plugin has not been loaded.

getCollection() ¶ public static

getCollection(): Cake\Core\PluginCollection

Get the shared plugin collection.

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

Returns
Cake\Core\PluginCollection

isLoaded() ¶ public static

isLoaded(string $plugin): bool

Returns true if the plugin $plugin is already loaded.

Parameters
string $plugin

Plugin name.

Returns
bool

loaded() ¶ public static

loaded(): array<string>

Return a list of loaded plugins.

Returns
array<string>

A list of plugins that have been loaded

path() ¶ public static

path(string $name): string

Returns the filesystem path for a plugin

Parameters
string $name

name of the plugin in CamelCase format

Returns
string

path to the plugin folder

Throws
Cake\Core\Exception\MissingPluginException
If the folder for plugin was not found or plugin has not been loaded.

templatePath() ¶ public static

templatePath(string $name): string

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

Parameters
string $name

name of the plugin in CamelCase format.

Returns
string

Path to the plugin folder containing template files.

Throws
Cake\Core\Exception\MissingPluginException
If plugin has not been loaded.

Property Detail

$plugins ¶ protected static

Holds a list of all loaded plugins and their configuration

Type
Cake\Core\PluginCollection|null
OpenHub
Pingping
Linode
  • Business Solutions
  • Showcase
  • Documentation
  • Book
  • API
  • Videos
  • Reporting Security Issues
  • Privacy Policy
  • Logos & Trademarks
  • Community
  • Get Involved
  • Issues (Github)
  • Bakery
  • Featured Resources
  • Training
  • Meetups
  • My CakePHP
  • CakeFest
  • Newsletter
  • Linkedin
  • YouTube
  • Facebook
  • Twitter
  • Mastodon
  • Help & Support
  • Forum
  • Stack Overflow
  • IRC
  • Slack
  • Paid Support

Generated using CakePHP API Docs