I need a help with Zend\Di;

I'm tired on the task of write factories to my application using the
Zend\ServiceManager, I want to understand how work the configuration in MVC
environment of Zend\Di.


I see this post of @Ocramius
(http://ocramius.github.io/blog/zend-framework-2-controllers-and-dependency-injection-with-zend-di/,
with some configuration in the `module.config.php`, in the top key `di`:

    <?php
    
    return array(
        'di' => array(
            'allowed_controllers' => array(
                // this config is required, otherwise the MVC won't even
attempt to ask Di for the controller!
                'Application\Controller\GreetingController',
            ),
    
            'instance' => array(
                'preference' => array(
                    // these allow injecting correct EventManager and
ServiceManager
                    // (taken from the main ServiceManager) into the
controller,
                    // because Di doesn't know how to retrieve abstract
types. These
                    // dependencies are inherited from
Zend\Mvc\Controller\AbstractController
                    'Zend\EventManager\EventManagerInterface' =>
'EventManager',
                    'Zend\ServiceManager\ServiceLocatorInterface' =>
'ServiceManager',
                ),
            ),
        ),
        // remaining config
    );


Anyone can post a url to the doc of this configuration or more detailed
examples here?



--
View this message in context: 
http://zend-framework-community.634137.n4.nabble.com/How-configure-Zend-Di-tp4662374.html
Sent from the Zend Framework mailing list archive at Nabble.com.

-- 
List: [email protected]
Info: http://framework.zend.com/archives
Unsubscribe: [email protected]


Reply via email to