Implemented EditShortCodeAction

This commit is contained in:
Alejandro Celaya
2018-01-07 20:45:05 +01:00
parent 7ba9eb8e2c
commit 84094a51a2
7 changed files with 189 additions and 13 deletions

View File

@@ -8,8 +8,24 @@ use Zend\Stdlib\Glob;
class ConfigProvider
{
const ROUTES_PREFIX = '/rest/v{version:1}';
public function __invoke()
{
return Factory::fromFiles(Glob::glob(__DIR__ . '/../config/{,*.}config.php', Glob::GLOB_BRACE));
return $this->applyRoutesPrefix(
Factory::fromFiles(Glob::glob(__DIR__ . '/../config/{,*.}config.php', Glob::GLOB_BRACE))
);
}
private function applyRoutesPrefix(array $config): array
{
$routes =& $config['routes'] ?? [];
// Prepend the routes prefix to every path
foreach ($routes as $key => $route) {
$routes[$key]['path'] = self::ROUTES_PREFIX . $route['path'];
}
return $config;
}
}