Add sub namespace for plugins

This commit is contained in:
Frederic Guillot
2015-09-20 13:11:41 -04:00
parent fe57edd9e8
commit a0124b45f9
5 changed files with 19 additions and 18 deletions

View File

@@ -47,9 +47,9 @@ Example of `Plugin.php` file (`plugins/Foobar/Plugin.php`):
namespace Plugin\Foobar;
use Core\PluginBase;
use Core\Plugin\Base;
class Plugin extends PluginBase
class Plugin extends Plugin\Base
{
public function initialize()
{
@@ -58,14 +58,14 @@ class Plugin extends PluginBase
}
```
This file should contains a class `Plugin` defined under the namespace `Plugin\Yourplugin` and extends `Core\PluginBase`.
This file should contains a class `Plugin` defined under the namespace `Plugin\Yourplugin` and extends `Core\Plugin\Base`.
The only required method is `initialize()`. This method is called for each request when the plugin is loaded.
Plugin methods
--------------
Available methods from `PluginBase`:
Available methods from `Plugin\Base`:
- `initialize()`: Executed when the plugin is loaded
- `getClasses()`: Return all classes that should be stored in the dependency injection container