I read around that DI works on our controllers, just by supplying our
instance, and our DI parameters. However, I can't seem to get it working
with 2.2.2. I added my controller to allowed_controllers, and it's still
not working.

I've also tried using 'version' in place of
"Firmware\Controller\FirmwareVerisonController" in case DI was dependent on
the alias names, vs the actual class name. setFirmwarePlatform is never
called, nothing is ever passed to my controller constructor.

The route and controller works, but the DI doesn't.

My config looks like so:

<?php
//....
    'router' => array(
        'routes' => array(
            'rest-api' => array(
                'type' => 'segment',
                'options' => array(
                    'route' => '/api/:version/rest/:controller',
                    'criteria' => array(
                        'version' => '\d+\.\d+',
                        'controller' => '[a-z][\w]+',
                    ),
                ),
            ),
        ),
    ),
//....
   'controllers' => array(
        'invokables' => array(
              'version' => 'Firmware\Controller\FirmwareVersionController',
        ),
   ),
//....
    'di' => array(
        'allowed_controllers' => array(
            'Firmware\Controller\FirmwareVersionController',
        ),
        'instance' => array(
            'Firmware\Controller\FirmwareVersionController' => array(
                'parameters' => array(
                    'firmwarePlatform' => 'Firmware\PlatformObject',
                ),
            ),
        ),
    ),


---
Philip
g...@gpcentre.net
http://www.gpcentre.net/

Reply via email to