Update doc blocks for CakePlugin::load().

Refs #5665
This commit is contained in:
mark_story 2015-06-11 22:17:18 -04:00
parent 6d60e6a4db
commit 56143c663e

View file

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