2017 © Pedro Peláez
 

library zf-ioc

Controller action dependency injection in Zend Framework 1 using Laravel's IoC container.

image

swisnl/zf-ioc

Controller action dependency injection in Zend Framework 1 using Laravel's IoC container.

  • Tuesday, March 27, 2018
  • by swisnl
  • Repository
  • 5 Watchers
  • 0 Stars
  • 61 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 9 Versions
  • 36 % Grown

The README.md

🚨 THIS PACKAGE HAS BEEN ABANDONED 🚨, (*1)

We don't use this package anymore in our own projects and cannot justify the time needed to maintain it anymore. That's why we have chosen to abandon it. Feel free to fork our code and maintain your own copy or use one of the many alternatives., (*2)

ZF-IoC

Controller action dependency injection in Zend Framework 1., (*3)

Does not have the framework as a composer dependency to support legacy projects (as that is the only reason this package exists)., (*4)

Currently requires PHP 5.4+ (as required by illuminate/container 5.0), (*5)

composer require jeroenvandergeer/zf-ioc
// Container of choice, can be any Laravel compatible container
$container = new \Illuminate\Container\Container();

// Build dispatcher with IoC container
$dispatcher = new \Jeroenvandergeer\ZfIoc\Dispatcher($container);

// Set / replace the dispatcher
$frontController = \Zend_Controller_Front::getInstance();
$frontController->setDispatcher($dispatcher);

// Optionally register the container with the Zend registry for global binding
\Zend_Registry::set('container', $container);

// Register binding
$container->bind('\App\FooInterface', function($container){
    return new \App\Foo($container['\App\Bar']);
});

Example #1

public function indexAction(\App\FooInterface $foo) 
{
    var_dump($foo);    
}
object(App\Foo)
  public 'bar' => 
    object(App\Bar)

Example #2

public function indexAction() 
{
    $container = $this->getInvokeArg('container');
    var_dump($container->make('\App\Foo'));
}
object(App\Foo)
  public 'bar' => 
    object(App\Bar)

The Versions

27/03 2018

dev-master

9999999-dev

Controller action dependency injection in Zend Framework 1 using Laravel's IoC container.

  Sources   Download

MIT

The Requires

 

by Jeroen van der Geer

27/03 2018

0.2.1

0.2.1.0

Controller action dependency injection in Zend Framework 1 using Laravel's IoC container.

  Sources   Download

MIT

The Requires

 

by Jeroen van der Geer

27/03 2018

0.2

0.2.0.0

Controller action dependency injection in Zend Framework 1 using Laravel's IoC container.

  Sources   Download

The Requires

 

by Jeroen van der Geer

27/03 2018

dev-develop

dev-develop

Controller action dependency injection in Zend Framework 1 using Laravel's IoC container.

  Sources   Download

The Requires

 

by Jeroen van der Geer

05/11 2015

0.1.4

0.1.4.0

Controller action dependency injection in Zend Framework 1 using Laravel's IoC container.

  Sources   Download

The Requires

 

by Jeroen van der Geer

22/06 2015

0.1.3

0.1.3.0

Controller action dependency injection in Zend Framework 1 using Laravel's IoC container.

  Sources   Download

The Requires

 

by Jeroen van der Geer

22/06 2015

0.1.2

0.1.2.0

Controller action dependency injection using Laravel's IoC container.

  Sources   Download

The Requires

 

by Jeroen van der Geer

21/06 2015

0.1.1

0.1.1.0

Controller action dependency injection using Laravel's IoC container.

  Sources   Download

The Requires

 

by Jeroen van der Geer

21/06 2015

0.1

0.1.0.0

Controller action dependency injection using Laravel's IoC container.

  Sources   Download

The Requires

 

by Jeroen van der Geer