Skip to content

Instantly share code, notes, and snippets.

@robertbasic
Created October 9, 2012 18:42
Show Gist options
  • Select an option

  • Save robertbasic/3860627 to your computer and use it in GitHub Desktop.

Select an option

Save robertbasic/3860627 to your computer and use it in GitHub Desktop.
<?php
//module.config.php
return array(
'factories' => array(
'model.Foo' => 'Foo\Factory\ModelFactory'
)
);
// Foo/Factory/ModelFactory.php
namespace Foo\Factory;
use Zend\ServiceManager\FactoryInterface;
use Zend\ServiceManager\ServiceLocatorInterface;
ModelFactory extends FactoryInterface
{
public function createService(ServiceLocatorInterface $locator, $name)
{
// $name == 'model.Foo';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment