# Slim Di-bridge with noodlehaus, having problems accessing the variables

**URL:** <https://discourse.slimframework.com/t/slim-di-bridge-with-noodlehaus-having-problems-accessing-the-variables/2831>\
**Category:** Questions\
**Created:** [November 21, 2018, 6:36pm UTC](https://discourse.slimframework.com/t/slim-di-bridge-with-noodlehaus-having-problems-accessing-the-variables/2831 "2018-11-21T18:36:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![supervan1](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.slimframework.com/supervan1/32/362_2.png) [@supervan1](https://discourse.slimframework.com/u/supervan1)\
**Post date:** [November 21, 2018, 6:36pm UTC](https://discourse.slimframework.com/t/slim-di-bridge-with-noodlehaus-having-problems-accessing-the-variables/2831/1 "2018-11-21T18:36:18Z")

</div>

Hi,

Im using Slim 3 with DI\Bridge\Slim\App and DI\ContainerBuilder

How can i access the variables & values in the Di-bridge, i have a noodlehaus instance with a configsettings.php file

```php
$app = new App(); // creating the DI\Bridge\Slim\App
$container = $app->getContainer();

$capsule = new Capsule();
//need to get the db settings -- line below problem
$capsule->addConnection($container['config']->get('db'));

```

file : configsettings.php

```php
return [
    'db' => [
        'driver' => 'mysql',
        'host' => ('localhost'),
        'database' => (''),
        'username' => ('root'),
        'password' => (''),
        'charset' => 'utf8',
        'collation' => 'utf8_unicode_ci',
        'prefix' => '',
    ],
    'settings' => [
        'displayErrorDetails' => true,
        'addContentLengthHeader' => false,
    ],
     'image' => [
            'cache' => [
                'path' => '../storage/cache/image/'
            ]
        ]
];

```

creating the di-bridge

```php
namespace Ti;

use DI\Bridge\Slim\App as DIBridge;
use DI\ContainerBuilder;

class App extends DIBridge
{

    protected function configureContainer(ContainerBuilder $builder)
        {
        $builder->addDefinitions([
            'settings.displayErrorDetails' => true,
            // i could add slim settings here, not sure what to do with Db and image etc 
        ]);
        $builder->addDefinitions( __DIR__. '/../config/container.php');
        }

}

```

file : config/container.php Created a new noodlehaus instance and ref the file

```php
return [
    \Noodlehaus\Config::class => function (ContainerInterface $container) {
        new \Noodlehaus\Config([ __DIR__. '/../config/configsettings.php',
        ]);
    },
    RouterInterface::class => function (ContainerInterface $container) {
        return $container->get('router');
    },
    // PS... Disable debug = true and Twig_Extension_Debug - use only for debuging 
    Twig::class => function (ContainerInterface $c) {
        $twig = new Twig( __DIR__. '/../twig/views', // need to retrieve setting from noodlehaus  

```
