2017 © Pedro Peláez
 

contao-module contao-dependency-container

Dependency container based on pimple for Contao open source cms.

image

bit3/contao-dependency-container

Dependency container based on pimple for Contao open source cms.

  • Sunday, January 18, 2015
  • by tril
  • Repository
  • 0 Watchers
  • 0 Stars
  • 377 Installations
  • 3 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 10 Versions
  • 0 % Grown

The README.md

Dependency Injection Container for Contao Open Source CMS

This DI Container based on Pimple., (*1)

Register parameters and services

system/modules/X/config/services.php, (*2)

$container['myservice.param'] = 'value';
$container['myservice'] = function($container) {
    return new MyServiceClassName();
}

Access parameters and services

class MyClass
{
    function myFunction()
    {
        global $container;

        $parameter = $container['myservice.param'];
        $service = $container['myservice'];
    }
}

Build-in services

The config object

/** @var \Config $config */
$config = $container['config'];

The environment object

/** @var \Environment $environment */
$environment = $container['environment'];

The database connection

/** @var \Database $database */
$database = $container['database.connection'];

The input object

/** @var \Input $input */
$input = $container['input'];

The backend or frontend user, depend on TL_MODE

/** @var \BackendUser|\FrontendUser $user */
$user = $container['user'];

The session object

/** @var \Session $session */
$session = $container['session'];

Lazy access to the $objPage object

/** @var DependencyInjection\Container\PageProvider */
$pageProvider = $container['page-provider'];
$page         = $pageProvider->getPage();

The Versions

12/11 2013

1.3

1.3.0.0

Dependency container based on pimple for Contao open source cms.

  Sources   Download

LGPL-3.0+

The Requires

 

container contao dependency di injection

12/11 2013

1.2.1

1.2.1.0

Dependency container based on pimple for Contao open source cms.

  Sources   Download

LGPL-3.0+

The Requires

 

container contao dependency di injection

23/09 2013

1.2

1.2.0.0

Dependency container based on pimple for Contao open source cms.

  Sources   Download

LGPL-3.0+

The Requires

 

container contao dependency di injection

12/07 2013

1.1

1.1.0.0

Dependency container based on pimple for Contao open source cms.

  Sources   Download

LGPL-3.0+

The Requires

 

container contao dependency di injection

09/07 2013

1.0.2

1.0.2.0

Dependency container based on pimple for Contao open source cms.

  Sources   Download

LGPL-3.0+

The Requires

 

container contao dependency di injection

27/06 2013

1.0.1

1.0.1.0

Dependency container based on pimple for Contao open source cms.

  Sources   Download

LGPL-3.0+

The Requires

 

container contao dependency di injection

17/05 2013

1.0

1.0.0.0

Dependency container based on pimple for Contao open source cms.

  Sources   Download

LGPL-3.0+

The Requires

 

container contao dependency di injection