2017 © Pedro Peláez
 

library di

PHPComponent/DI is Dependency Injection container

image

php-component/di

PHPComponent/DI is Dependency Injection container

  • Sunday, October 15, 2017
  • by sitner
  • Repository
  • 1 Watchers
  • 0 Stars
  • 6 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 9 Versions
  • 0 % Grown

The README.md

PHPComponent\DI

DI is Dependency Injection container. It will build whole dependency tree of your application., (*1)

Configuration example

You can configure container using PHP. For example you have class Translator, which have one constructor parameter $default_language., (*2)

class Translator
{
    /** @var string */
    private $default_language;

    public function __construct($default_language)
    {
        $this->default_language = $default_langauge;
    }
}

Then you configure Container., (*3)

$parameters = new \PHPComponent\DI\ParametersBag(array('default_language' => 'en'));
$container_builder = new \PHPComponent\DI\ContainerBuilder($parameters);
$container_builder->registerService('translator', Translator::class)
    ->setArguments(array('%default_language%'));
$translator = $container_builder->getService('translator');

When you call getService('translator') you will get Translator with default language en., (*4)

The Versions

15/10 2017

dev-master

9999999-dev

PHPComponent/DI is Dependency Injection container

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by František Šitner

ioc di

15/10 2017

0.2.6

0.2.6.0

PHPComponent/DI is Dependency Injection container

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by František Šitner

ioc di

15/10 2017

0.2.5

0.2.5.0

PHPComponent/DI is Dependency Injection container

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by František Šitner

ioc di

08/10 2017

0.2.4

0.2.4.0

PHPComponent/DI is Dependency Injection container

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by František Šitner

ioc di

21/09 2017

0.2.3

0.2.3.0

PHPComponent/DI is Dependency Injection container

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by František Šitner

ioc di

19/09 2017

0.2.2

0.2.2.0

PHPComponent/DI is Dependency Injection container

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by František Šitner

ioc di

18/09 2017

0.2.1

0.2.1.0

PHPComponent/DI is Dependency Injection container

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by František Šitner

ioc di

17/09 2017

0.2.0

0.2.0.0

PHPComponent/DI is Dependency Injection container

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by František Šitner

ioc di

17/09 2017

0.1.0

0.1.0.0

PHPComponent/DI is Dependency Injection container

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by František Šitner

ioc di