SlimCMS\Modules\SModuleManager::decoratorsInit PHP Method

decoratorsInit() protected method

Set decorators class by module
protected decoratorsInit ( string $name, array $decorators )
$name string
$decorators array
    protected function decoratorsInit($name, array $decorators)
    {
        foreach ($decorators as $decorClass) {
            if (!class_exists($decorClass)) {
                throw new \Exception("Class decorator \"{$decorClass}\" - not found", 1);
            }
            $this->moduleContainer->extend($name, function ($module) use($decorClass) {
                return new $decorClass($module);
            });
        }
    }