Skip to content

Instantly share code, notes, and snippets.

@alexshelkov
Created October 29, 2012 16:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexshelkov/3974486 to your computer and use it in GitHub Desktop.
Save alexshelkov/3974486 to your computer and use it in GitHub Desktop.
use Zend\ServiceManager\ServiceLocatorInterface;
class SimpleHelperFactory implements \Zend\ServiceManager\FactoryInterface
{
public function createService(ServiceLocatorInterface $serviceLocator)
{
// Can't do the same here, because of ServiceLocatorInterface
$config = $serviceLocator->getServiceLocator()->get('Config');
// Or I can just ignore problem with ServiceLocatorInterface interface here
return new SimpleHelper();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment