2017 © Pedro Peláez
 

contao-bundle dependency-container

Dependency container based on pimple for Contao open source cms.

image

contao-community-alliance/dependency-container

Dependency container based on pimple for Contao open source cms.

  • Sunday, February 11, 2018
  • by xtra
  • Repository
  • 8 Watchers
  • 1 Stars
  • 50,412 Installations
  • PHP
  • 50 Dependents
  • 0 Suggesters
  • 3 Forks
  • 0 Open issues
  • 28 Versions
  • 2 % Grown

The README.md

Dependency Injection Container for Contao Open Source CMS

Version Build Status License Downloads, (*1)

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

NOTE on Contao 4: This is obsolete in Contao 4 - you should use the symfony container in Contao 4., (*3)

This extension keeps compatibility for easing migration to Contao 4 - however, you should change your code to register your services using both registration ways., (*4)

For a howto of how to migrate to Contao 4, please refer to the UPGRADING-TO-CONTAO4.md, (*5)

Register parameters and services

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

$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

11/02 2018

dev-master

9999999-dev http://c-c-a.org/

Dependency container based on pimple for Contao open source cms.

  Sources   Download

LGPL-3.0+ LGPL-3.0-or-later

The Requires

 

The Development Requires

container contao dependency di injection

11/02 2018

dev-develop

dev-develop http://c-c-a.org/

Dependency container based on pimple for Contao open source cms.

  Sources   Download

LGPL-3.0+ LGPL-3.0-or-later

The Requires

 

The Development Requires

container contao dependency di injection

11/02 2018

2.0.1

2.0.1.0 http://c-c-a.org/

Dependency container based on pimple for Contao open source cms.

  Sources   Download

LGPL-3.0-or-later

The Requires

 

The Development Requires

container contao dependency di injection

16/01 2018

2.0.0

2.0.0.0 http://c-c-a.org/

Dependency container based on pimple for Contao open source cms.

  Sources   Download

LGPL-3.0+

The Requires

 

The Development Requires

container contao dependency di injection

28/07 2017

dev-release/2.0.0

dev-release/2.0.0 http://c-c-a.org/

Dependency container based on pimple for Contao open source cms.

  Sources   Download

LGPL-3.0+

The Requires

 

The Development Requires

container contao dependency di injection

25/11 2016

dev-feature/contao4

dev-feature/contao4 http://c-c-a.org/

Dependency container based on pimple for Contao open source cms.

  Sources   Download

LGPL-3.0+

The Requires

 

The Development Requires

container contao dependency di injection

08/12 2015

1.8.3

1.8.3.0 http://c-c-a.org/

Dependency container based on pimple for Contao open source cms.

  Sources   Download

LGPL-3.0+

The Requires

 

The Development Requires

container contao dependency di injection

08/12 2015

dev-support/1.8.x

dev-support/1.8.x http://c-c-a.org/

Dependency container based on pimple for Contao open source cms.

  Sources   Download

LGPL-3.0+

The Requires

 

The Development Requires

container contao dependency di injection

08/12 2015

1.8.2

1.8.2.0 http://c-c-a.org/

Dependency container based on pimple for Contao open source cms.

  Sources   Download

LGPL-3.0+

The Requires

 

The Development Requires

container contao dependency di injection

07/07 2015

1.8.1

1.8.1.0 http://c-c-a.org/

Dependency container based on pimple for Contao open source cms.

  Sources   Download

LGPL-3.0+

The Requires

 

The Development Requires

container contao dependency di injection

05/02 2015

1.8.0

1.8.0.0 http://c-c-a.org/

Dependency container based on pimple for Contao open source cms.

  Sources   Download

LGPL-3.0+

The Requires

 

The Development Requires

container contao dependency di injection

05/06 2014

1.5

1.5.0.0 http://c-c-a.org/

Dependency container based on pimple for Contao open source cms.

  Sources   Download

LGPL-3.0+

The Requires

 

container contao dependency di injection

27/05 2014

1.4.1

1.4.1.0 http://c-c-a.org/

Dependency container based on pimple for Contao open source cms.

  Sources   Download

LGPL-3.0+

The Requires

 

container contao dependency di injection

19/12 2013

1.4

1.4.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.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