for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* YAWIK
*
* @filesource
* @copyright (c) 2013 - 2016 Cross Solution (http://cross-solution.de)
* @license MIT
*/
namespace Organizations\Factory\Controller;
use Interop\Container\ContainerInterface;
use Organizations\Controller\IndexController;
use Organizations\Repository;
use Organizations\Form;
use Zend\Mvc\Controller\ControllerManager;
use Zend\ServiceManager\FactoryInterface;
use Zend\ServiceManager\ServiceLocatorInterface;
class IndexControllerFactory implements FactoryInterface
{
* Create a IndexController controller
* @param ContainerInterface $container
* @param string $requestedName
* @param null|array $options
* @return IndexController
public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
$organizationRepository = $container->get('repositories')->get('Organizations/Organization');
$form = new Form\Organizations(null);
return new IndexController($form, $organizationRepository);
}
* Create service
* @param ServiceLocatorInterface $serviceLocator
public function createService(ServiceLocatorInterface $serviceLocator)
/** @var ControllerManager $serviceLocator */
return $this($serviceLocator->getServiceLocator(), IndexController::class);