diff options
author | Frederic Guillot <fred@kanboard.net> | 2015-09-13 16:56:51 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2015-09-13 16:56:51 -0400 |
commit | 4b6672d0b33563ab8888d592ef86616ca9238007 (patch) | |
tree | 0ba5c0b2244f08ddac55169161271ca2a25ce005 /app/Core/PluginBase.php | |
parent | d400f7c5be4b3f7371dce73510e5fd4a54375025 (diff) |
Move budget outside of the core
The budget planning feature is now a plugin
See: https://github.com/kanboard/plugin-budget
Diffstat (limited to 'app/Core/PluginBase.php')
-rw-r--r-- | app/Core/PluginBase.php | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/app/Core/PluginBase.php b/app/Core/PluginBase.php index 9c3d6e32..457afa03 100644 --- a/app/Core/PluginBase.php +++ b/app/Core/PluginBase.php @@ -28,4 +28,20 @@ abstract class PluginBase extends Base { return array(); } + + /** + * Listen on internal events + * + * @access public + * @param string $event + * @param callable $callback + */ + public function on($event, $callback) + { + $container = $this->container; + + $this->container['dispatcher']->addListener($event, function() use ($container, $callback) { + call_user_func($callback, $container); + }); + } } |