PHPackages                             yii1tech/di - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [PSR &amp; Standards](/categories/psr-standards)
4. /
5. yii1tech/di

ActiveLibrary[PSR &amp; Standards](/categories/psr-standards)

yii1tech/di
===========

Provides Dependency Injection support for Yii1 application

1.0.4(2y ago)33.2k↑171.4%1BSD-3-ClausePHPPHP &gt;=7.2

Since Jul 28Pushed 1y ago1 watchersCompare

[ Source](https://github.com/yii1tech/di)[ Packagist](https://packagist.org/packages/yii1tech/di)[ GitHub Sponsors](https://github.com/klimov-paul)[ Patreon](https://www.patreon.com/klimov_paul)[ RSS](/packages/yii1tech-di/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependencies (3)Versions (6)Used By (0)

 [ ![](https://avatars.githubusercontent.com/u/134691944) ](https://github.com/yii1tech)

Yii1 Dependency Injection Extension
===================================

[](#yii1-dependency-injection-extension)

This extension provides Dependency Injection support for Yii1 application.

For license information check the [LICENSE](LICENSE.md)-file.

[![Latest Stable Version](https://camo.githubusercontent.com/6ad4d86973cd8ab75b03ace1dc35061fa579fc1a25910410f9fde2ca95b003c7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f79696931746563682f64692e737667)](https://packagist.org/packages/yii1tech/di)[![Total Downloads](https://camo.githubusercontent.com/3395748abd09aab030a76c9e86f3b799ec658e89373af6dced8dcc1f7971c20d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f79696931746563682f64692e737667)](https://packagist.org/packages/yii1tech/di)[![Build Status](https://github.com/yii1tech/di/workflows/build/badge.svg)](https://github.com/yii1tech/di/actions)

Installation
------------

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require --prefer-dist yii1tech/di

```

or add

```
"yii1tech/di": "*"
```

to the "require" section of your composer.json.

Usage
-----

[](#usage)

This extension provides Dependency Injection support for Yii1 application using [PSR-11](https://www.php-fig.org/psr/psr-11/) compatible container.

This extension introduces static facade class `\yii1tech\di\DI`, which provides global access to PSR container and injector. All dependency injection features provided in this extension relies on this facade. It provides easy way for container entity retrieval and dependency injection. For example:

```
