Added config module
This commit is contained in:
10
src/app.php
10
src/app.php
@ -1,6 +1,8 @@
|
||||
<?php
|
||||
|
||||
use DI\Container;
|
||||
use Noodlehaus\Config;
|
||||
use Noodlehaus\Parser\Json;
|
||||
use Slim\Factory\AppFactory;
|
||||
use Slim\Views\Twig;
|
||||
use Slim\Views\TwigMiddleware;
|
||||
@ -8,13 +10,13 @@ use Slim\Views\TwigMiddleware;
|
||||
require __DIR__ . '/../vendor/autoload.php';
|
||||
|
||||
// Load app configuration
|
||||
//$config = Config::load(__DIR__ . '/../conf/defaults.json');
|
||||
$config = Config::load(__DIR__ . '/../conf/defaults.json');
|
||||
|
||||
// Create new container object and add our config object to it
|
||||
$container = new Container();
|
||||
//$container->set('config', function () use ($config) {
|
||||
// return $config;
|
||||
//});
|
||||
$container->set('config', function () use ($config) {
|
||||
return $config;
|
||||
});
|
||||
|
||||
// Set container to create App with on AppFactory
|
||||
AppFactory::setContainer($container);
|
||||
|
Reference in New Issue
Block a user