Created
August 29, 2012 14:04
-
-
Save weierophinney/3513012 to your computer and use it in GitHub Desktop.
Example factory
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
<?php | |
$factory = function ($controllers) { | |
$services = $controllers->getServiceLocator(); | |
$config = $services->get('Config'); | |
$moduleConfig = $config['my_module_key']; | |
$controller = new Controller\SomeController(); | |
$controller->setSomeConfigInfo($moduleConfig['some_config_info']); | |
return $controller; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment