Skip to content
Permalink
Browse files

Update doc blocks for CakePlugin::load().

Refs #5665
  • Loading branch information...
markstory committed Jun 12, 2015
1 parent 6d60e6a commit 56143c663e14b810965da8146a9bde50ddf8b857
Showing with 25 additions and 8 deletions.
  1. +25 −8 lib/Cake/Core/CakePlugin.php
@@ -37,14 +37,29 @@ class CakePlugin {
*
* Examples:
*
* `CakePlugin::load('DebugKit')` will load the DebugKit plugin and will not load any bootstrap nor route files
* `CakePlugin::load('DebugKit', array('bootstrap' => true, 'routes' => true))` will load the bootstrap.php and routes.php files
* `CakePlugin::load('DebugKit', array('bootstrap' => false, 'routes' => true))` will load routes.php file but not bootstrap.php
* `CakePlugin::load('DebugKit', array('bootstrap' => array('config1', 'config2')))` will load config1.php and config2.php files
* `CakePlugin::load('DebugKit', array('bootstrap' => 'aCallableMethod'))` will run the aCallableMethod function to initialize it
* `CakePlugin::load('DebugKit')`
*
* Bootstrap initialization functions can be expressed as a PHP callback type, including closures. Callbacks will receive two
* parameters (plugin name, plugin configuration)
* Will load the DebugKit plugin and will not load any bootstrap nor route files
*
* `CakePlugin::load('DebugKit', array('bootstrap' => true, 'routes' => true))`
*
* will load the bootstrap.php and routes.php files
*
* `CakePlugin::load('DebugKit', array('bootstrap' => false, 'routes' => true))`
*
* will load routes.php file but not bootstrap.php
*
* `CakePlugin::load('DebugKit', array('bootstrap' => array('config1', 'config2')))`
*
* will load config1.php and config2.php files
*
* `CakePlugin::load('DebugKit', array('bootstrap' => 'aCallableMethod'))`
*
* will run the aCallableMethod function to initialize it
*
* Bootstrap initialization functions can be expressed as a PHP callback type,
* including closures. Callbacks will receive two parameters
* (plugin name, plugin configuration)
*
* It is also possible to load multiple plugins at once. Examples:
*
@@ -63,7 +78,9 @@ class CakePlugin {
* ), array('bootstrap' => true))
* ```
*
* Will only load the bootstrap for ApiGenerator and only the routes for DebugKit
* Will only load the bootstrap for ApiGenerator and only the routes for DebugKit.
* By using the `path` option you can specify an absolute path to the plugin. Make
* sure that the path is slash terminated or your plugin will not be located properly.
*
* @param string|array $plugin name of the plugin to be loaded in CamelCase format or array or plugins to load
* @param array $config configuration options for the plugin

0 comments on commit 56143c6

Please sign in to comment.
You can’t perform that action at this time.