Skip to content

Instantly share code, notes, and snippets.

@weierophinney
Created August 29, 2012 14:04
Show Gist options
  • Save weierophinney/3513012 to your computer and use it in GitHub Desktop.
Save weierophinney/3513012 to your computer and use it in GitHub Desktop.
Example factory
<?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