diff options
author | Busfreak <martin@middeke.de> | 2016-03-23 18:06:16 +0100 |
---|---|---|
committer | Busfreak <martin@middeke.de> | 2016-03-23 18:06:16 +0100 |
commit | 4f2468fc3881ebeefc70e19479606496cec0c6cb (patch) | |
tree | 176d735d9b822c94fa89b643e94f0a407b93038f /app/Core/Tool.php | |
parent | 2425fd85c04e7ad6e571da1848bb8d4b54499394 (diff) |
Loader for Helper-Classes from Plugin
Diffstat (limited to 'app/Core/Tool.php')
-rw-r--r-- | app/Core/Tool.php | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/app/Core/Tool.php b/app/Core/Tool.php index edd2e609..db2445a1 100644 --- a/app/Core/Tool.php +++ b/app/Core/Tool.php @@ -56,6 +56,27 @@ class Tool } /** + * Build dependency injection container for custom helpers from an array + * + * @static + * @access public + * @param Container $container + * @param array $namespaces + * @return Container + */ + public static function buildDICHelpers(Container $container, array $namespaces) + { + foreach ($namespaces as $namespace => $classes) { + foreach ($classes as $name) { + $class = '\\Kanboard\\'.$namespace.'\\'.$name; + $container['helper']->register($name, $class); + } + } + + return $container; + } + + /** * Generate a jpeg thumbnail from an image * * @static |