public function __construct($c) { foreach (new \DirectoryIterator(__DIR__) as $file) { if ($file->isFile()) { \Hal\Core\Registry::register('system/helper/' . $file, 'system/helper/' . $file); require_once dirname(__FILE__) . '/' . $file->getFilename(); } } }
}; $app['search'] = function ($c) { \Hal\Core\Registry::register('toolbox/search', 'toolbox/search'); return new \Hal\Toolbox\Search($c['database']); }; $app['session'] = function ($c) { \Hal\Core\Registry::register('toolbox/session', 'toolbox/session'); return new \Hal\Core\Session(); }; $app['slider'] = function ($c) { \Hal\Core\Registry::register('toolbox/slider', 'toolbox/slider'); return new \Hal\Toolbox\Slider($c); }; $app['title'] = function ($c) { \Hal\Core\Registry::register('toolbox/title', 'toolbox/title'); require_once TOOLBOX_PATH . 'Titlesettings.php'; $title = new \Hal\Toolbox\Title($c['toolbox']); # Pass the Titlesettings() function from the included file above to $title->set() $title->set(Titlesettings($c)); return $title; }; $app['validate'] = function ($c) { \Hal\Core\Registry::register('toolbox/validate', 'toolbox/validate'); return new \Hal\Toolbox\Validation(); }; $app['toolbox'] = function ($c) { \Hal\Core\Registry::register('toolbox/toolbox', 'toolbox/toolbox'); // Used to pass the toolbox as a function parameter to other objects return $c; }; $hal = $app['core'];