Hi All,

I am trying to get my head around the best way to configure the service
manager.

Am I correct in thinking that if I have a ServiceManager defined with
anonymous functions like so: (Added to 'factories' configuration key)

...
'Album\Controller\Foo' => function($sm) {

    $dependancy = new \stdClass();
    $dependancy->bar = 'hello Foo!';
    $controller = new FooController($dependancy);
    $controller->setFooService($dependancy);

},
...

it will be called upon every request?

As opposed to defining a factory class:

'Album\Controller\Foo' => 'Album\Service\FooControllerFactory'

Which will be called when we use the service key:  'Album\Controller\Foo'

Is this correct?

Many Thanks.
Daniel

Reply via email to