/** * Add all mandatory paths to configuration */ public static function preInit() { /* add application & t41 config files path (in first position if none was declared before) */ Config::addPath(self::$basePath . 'application/configs/', Config::REALM_CONFIGS); Config::addPath(self::$basePath . 'vendor/quatrain/t41/configs/', Config::REALM_CONFIGS); /* add templates folder path (in first position if none was declared before) */ Config::addPath(self::$basePath . 'application/views/', Config::REALM_TEMPLATES); /* add t41 & application controllers paths (in first position if none was declared before) */ Config::addPath(self::$basePath . 'application/controllers/', Config::REALM_CONTROLLERS, null, 'default'); Config::addPath(self::$basePath . 'vendor/quatrain/t41/controllers/', Config::REALM_CONTROLLERS, null, 't41'); /* register default REST controllers path */ /* @todo allow override in config file or even later */ Config::addPath(self::$basePath . 'vendor/quatrain/t41/controllers/rest/', Config::REALM_CONTROLLERS, null, 'rest'); /* register default path where to find view objects decorators */ Decorator::addPath(self::$basePath . 'vendor/quatrain/t41/library/t41'); // without 'View' }
public static function bind(array $config, $path, Layout\Menu $menu = null) { $store = $config['enabled'] == true ? 'enabled' : 'disabled'; if ($store == 'disabled') { return; } Config::addPath($path . '/configs/', Config::REALM_CONFIGS); // if modules has model, declare path to the autoloader if (is_dir($path . '/models') && isset($config['namespace'])) { Core::addAutoloaderPrefix($config['namespace'], $path . '/models/'); Config::addPath($path . '/models', Config::REALM_OBJECTS, null, $config['namespace']); } // Register views directory if it exists if (is_dir($path . '/views')) { // Config::addPath($path . '/views', Config::REALM_TEMPLATES, Config::POSITION_TOP); } }