Skip to content

Instantly share code, notes, and snippets.

@nclundsten
Created March 27, 2013 07:43
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 nclundsten/5252459 to your computer and use it in GitHub Desktop.
Save nclundsten/5252459 to your computer and use it in GitHub Desktop.
<?php
namespace Market\Factory;
use Market\Controller\PostController;
use Zend\ServiceManager\FactoryInterface;
use Zend\ServiceManager\ServiceLocatorInterface;
class PostControllerFactory implements FactoryInterface
{
public function createService(ServiceLocatorInterface $controllers)
{
$allServices = $controllers->getServiceLocator();
$sm = $allServices->get('ServiceManager');
$controller = new PostController();
$controller->setListingsTable($sm->get('listings-table'));
$controller->setCityCodesTable($sm->get('city-codes-table'));
$controller->setPostForm($sm->get('post-form'));
$controller->setPostFormFilter($sm->get('post-form-filter'));
$controller->setMailTransport($sm->get('mail-transport'));
$controller->setEmailInfo($sm->get('email-info'));
$controller->setParams($sm->get('params'));
$controller->setCategories($sm->get('categories'));
return $controller;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment