Dependency injection by Interface

Hello all

I’m experiencing problem with Dependency Injection, particularly with injecting of Repository class into controller.

I’m specifying which class to instantiate the way it’s specified in guide (in the entry script, after requiring the Yii.php):

Yii::$container->set('app\lib\CategoryRepositoryInterface', 'app\lib\CategoryRepository');

But when I’m injecting it in the constructor of Controller, DI container doesn’t pick up the dependency and trying to instantiate


, not



I’m new to Yii, so maybe I’m missing something?