# Namespace and PHP-DI

**URL:** <https://discourse.slimframework.com/t/namespace-and-php-di/5070>\
**Category:** Questions\
**Created:** [January 8, 2022, 6:29pm UTC](https://discourse.slimframework.com/t/namespace-and-php-di/5070 "2022-01-08T18:29:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ogurchik](https://avatars.discourse-cdn.com/v4/letter/o/c57346/32.png) [@ogurchik](https://discourse.slimframework.com/u/ogurchik)\
**Post date:** [January 8, 2022, 6:29pm UTC](https://discourse.slimframework.com/t/namespace-and-php-di/5070/1 "2022-01-08T18:29:25Z")

</div>

Hi, sorry for off top, but I scary to ask this on StackOverflow.  
I begin to use PHP-DI in my project and I saw this

```php
use Roma\DiContainerSlim\Models\UserManager as UserManager;

$container = new \DI\Container();
$userManager = $container->get('Roma\DiContainerSlim\Models\UserManager');

```

It’s working. But if I do this

`$container->get('UserManager');`

It’s not work. Honestly, I try googling but I found nothing.

---

<div class="post-metadata">

**Author:** ![darkalchemy](https://avatars.discourse-cdn.com/v4/letter/d/ad7895/32.png) [@darkalchemy](https://discourse.slimframework.com/u/darkalchemy)\
**Post date:** [January 12, 2022, 10:29pm UTC](https://discourse.slimframework.com/t/namespace-and-php-di/5070/2 "2022-01-12T22:29:06Z")

</div>

Hey @ogurchik,

Try this:

```auto
$container->get(UserManager::class);

```
