Skip to content

marcovtwout/yii-php-di

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

yii-php-di

PHP-DI integration for Yii 1. @see http://php-di.org/

Requirements

Installation

  1. Place the wrapper in your application. (@todo: Composer install)
  2. Add the application component in config/main.php:
'components' => array(
    ...
    'container' => array(
        'class' => 'path.to.DIContainerWrapper',
        //'definitions' => array()
    ),
    ...

Usage

Only call the container from your controllers. Don't call or inject the container on a lower level (into models or components), or you are not really using Dependency Injection.

Yii::app()->container->get('MyClass');

About

PHP-DI integration for Yii 1.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages