It's actually much simpler than that!

The 'config' service made available as default by Zend\Mvc is just a
service like any other, the concept is always the same: if you need a
dependency to instantiate a service, just register it in the SM to make it
available to that service.

So there you go: https://gist.github.com/stefanotorresi/8399139

You may want to get it further and use an AbstractOption subclass to
enforce defaults and/or validate configs.

By the way, yes, anonymous functions inside configurations array are not
cacheable, and so are object instances (i.e. using 'new Obj()' as an array
value).

Reply via email to