Advertisement
Guest User

Untitled

a guest
Dec 20th, 2014
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: renan
  5. * Date: 20/12/2014
  6. * Time: 15:03
  7. */
  8.  
  9. namespace Market\Factory;
  10.  
  11. use Market\Controller\PostController;
  12. use Zend\ServiceManager\FactoryInterface;
  13. use Zend\ServiceManager\ServiceLocatorInterface;
  14.  
  15. class PostControllerFactory implements FactoryInterface
  16. {
  17. public function createService(ServiceLocatorInterface $controllerManager)
  18. {
  19. $serviceLocator = $controllerManager->getServiceLocator();
  20. $serviceManager = $serviceLocator->get('ServiceManager');
  21. $categories = $serviceManager->get('categories');
  22. $controller = new PostController();
  23.  
  24. $controller->setCategories($categories);
  25.  
  26. return $controller;
  27. }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement