You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 24, 2018. It is now read-only.
The first comment mentions 2 bugs in the documentation:
I have found two bugs in the documentation. At first, 'new Configuration' should be replaced with 'new Config' and the second thing is that there is no method 'setLocator' in the stable version of ZF2.
The Configuration to Config is already fixed in #1345.
The second bug needs a fix. I can confirm Zend\Mvc\Application::setLocator does not exist, but I'm not sure what the code should be. The current code is this:
protectedfunctionsetupDi(Application$app)
{
$definitionList = newDefinitionList(array(
newDefinition\ArrayDefinition(include__DIR__ . '/path/to/data/di/My_MovieApp-definition.php'),
newDefinition\ArrayDefinition(include__DIR__ . '/path/to/data/di/My_OtherClasses-definition.php'),
$runtime = newDefinition\RuntimeDefinition(),
));
$di = newDi($definitionList, null, newConfig($this->config->di));
$di->instanceManager()->addTypePreference('Zend\Di\LocatorInterface', $di);
$app->setLocator($di); // <---- this line is not correct
}
The text was updated successfully, but these errors were encountered:
@Martin-P the standard Zend\Mvc\Application allows you to configure Zend\Di as abstract factory backing the main Zend\ServiceManager\ServiceManager of the application.
The only supported way to use Zend\Di is to have an $app->getServiceManager()->get('Config')['di']
The first comment mentions 2 bugs in the documentation:
The
Configuration
toConfig
is already fixed in #1345.The second bug needs a fix. I can confirm
Zend\Mvc\Application::setLocator
does not exist, but I'm not sure what the code should be. The current code is this:The text was updated successfully, but these errors were encountered: