News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Kevin Schroeder's Blog:
ZF2 Dependency Injection Managing Configuration - Part 1
April 26, 2012 @ 08:56:50

Kevin Schroeder has a new post talking about dependency injection in a Zend Framework v2-based application and managing your configurations.

In my previous blog post I showed how you could provide parameters to object that you're pulling from a DiC and have them populated in the resulting object. As cool as that is, it's not a massive saving as you need to manually inject the parameters into the DiC. You can often do the same thing by setting up the DiC ahead of time to get the object with those parameters pre-set.

He defines a class (Test) and shows how you can replace the DI container example with a ZendDiConfiguration object that contains the config options. He shows how to use this newly created container to access an instance of this "Test" class.

0 comments voice your opinion now!
zendframework2 dependency injection configuration tutorial


blog comments powered by Disqus

Similar Posts

Label Media Blog: Design Patterns in PHP - Decorator Pattern

DevShed: PHP and the Law of Demeter

Hari KT: Zend Feed and Guzzle

Slawek Lukasiewicz's Blog: Zend Framework: logging with Firebug and FirePHP

Vid Luther's Blog: Building PHP 5.3 packages on Ubuntu 9.04 (Jaunty) for Apache 2


Community Events

Don't see your event here?
Let us know!


api framework voicesoftheelephpant php7 unittest introduction interview example release podcast series language library install extension xdebug opinion laravel5 community laravel

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework