Created
June 1, 2012 17:07
-
-
Save TomHAnderson/2853671 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add to module/Application/config/module.config.php | |
'di' => array( | |
'instance' => array( | |
'alias' => array( | |
'idx' => 'Application\Controller\IndexController' | |
), | |
), | |
), | |
in module/Application/Module.php | |
public function onBootstrap($e) { | |
$sm = $e->getTarget()->getServiceManager(); | |
var_dump($sm->get('idx'));die(); | |
} | |
throws | |
Fatal error: Uncaught exception 'Zend\ServiceManager\Exception\ServiceNotCreatedException' with message 'Zend\ServiceManager\ServiceManager::get was unable to fetch or create an instance for idx' in /private/var/www/soliant/ZendSkeletonApplication/vendor/zendframework/zendframework/library/Zend/ServiceManager/ServiceManager.php:294 | |
Stack trace: | |
#0 /private/var/www/soliant/ZendSkeletonApplication/module/Application/Module.php(14): Zend\ServiceManager\ServiceManager->get('idx') | |
#1 [internal function]: Application\Module->onBootstrap(Object(Zend\Mvc\MvcEvent)) | |
#2 /private/var/www/soliant/ZendSkeletonApplication/vendor/zendframework/zendframework/library/Zend/EventManager/EventManager.php(463): call_user_func(Array, Object(Zend\Mvc\MvcEvent)) | |
#3 /private/var/www/soliant/ZendSkeletonApplication/vendor/zendframework/zendframework/library/Zend/EventManager/EventManager.php(205): Zend\EventManager\EventManager->triggerListeners('bootstrap', Object(Zend\Mvc\MvcEvent), Array) | |
#4 /private/var/www/soliant/ZendSkeletonApplication/vend in /private/var/www/soliant/ZendSkeletonApplication/vendor/zendframework/zendframework/library/Zend/ServiceManager/ServiceManager.php on line 294 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment