diff options
author | Frederic Guillot <fred@kanboard.net> | 2016-03-24 18:40:49 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2016-03-24 18:40:49 -0400 |
commit | 3a5f5abda2735f3ecf0e02bab3ee5fc11ed3e5bd (patch) | |
tree | de66ddebe8f62e5f919245803329f6dae8a92514 /app/Core/Tool.php | |
parent | e5812d33ec6e2fad69b7e3ee1eecedcb1c4ae4fa (diff) | |
parent | 4f2468fc3881ebeefc70e19479606496cec0c6cb (diff) |
Merge pull-request #2044
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 |