-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Module::getServiceConfig() returning a Configuration instance #113
Comments
ModuleManagerFactory gets booted: <?php
$serviceListener->addServiceManager(
$serviceLocator,
'service_manager',
'Zend\ModuleManager\Feature\ServiceProviderInterface',
'getServiceConfig'
); addServiceManager results in this: <?php
$this->serviceManagers[$smKey] = array(
'service_manager' => $serviceManager,
'config_key' => $key,
'module_class_interface' => $moduleInterface,
'module_class_method' => $method,
'configuration' => array(),
); This implies that getServiceConfig() becomes <?php
$config = $module->{$sm['module_class_method']}();
?> It seems to get registered here: https://github.com/zendframework/zf2/blob/master/library/Zend/ModuleManager/Listener/ServiceListener.php#L223 <?php
$serviceConfig = new ServiceConfig($smConfig);
$serviceConfig->configureServiceManager($sm['service_manager']); |
Just a note: don't use |
Also note that |
@Ocramius thanks for the tips. It's a bit challenging wrapping my head around the latest ZF2 code since you've reafactored a lot of things into the new Zend\Mvc component. |
@dragoonis nothing has changed since 2.0.0 on this front :-) |
From http://framework.zend.com/manual/2.0/en/modules/zend.service-manager.quick-start.html#modules-as-service-providers
Module Returning an Array
The following demonstrates returning an array of configuration from a module class. It can be substantively the same as the array configuration from the previous example.
Returning a Configuration instance
First, let’s create a class that holds configuration.
Now, we’ll consume it from our Module.
End of citation.
We need to support all of these alternatives.
The text was updated successfully, but these errors were encountered: