/** * Create service * * @param ServiceLocatorInterface|HelperPluginManager $serviceLocator * * @return mixed */ public function createService(ServiceLocatorInterface $serviceLocator) { /** @var $form Form */ $form = $serviceLocator->create('form'); /** @var $view PhpRenderer */ $view = $form->getView(); $view->getHelperPluginManager()->setAlias('formRow', 'adminFormRow'); return $form; }
/** * Create service * * @param ServiceLocatorInterface $serviceLocator * @return mixed */ public function createService(ServiceLocatorInterface $serviceLocator) { /** @var \GkSmarty\ModuleOptions $options */ $options = $serviceLocator->get('GkSmarty\\ModuleOptions'); /** @var \Zend\View\Resolver\TemplatePathStack */ $templatePathStack = $serviceLocator->create('ViewTemplatePathStack'); $templatePathStack->setDefaultSuffix($options->getSuffix()); return $templatePathStack; }
/** * @param ServiceLocatorInterface $serviceLocator * @return SerializationContext */ public function createService(ServiceLocatorInterface $serviceLocator) { /** @var ServiceManager $serviceLocator */ /** @var SerializerInterface $serializer */ $serializer = $serviceLocator->get('Aeris\\ZendRestModule\\Serializer'); /** @var SerializationContext $context */ $context = $serviceLocator->create('Aeris\\ZendRestModule\\Serializer\\SerializationContext'); $jsonModel = new SerializedJsonModel(); $jsonModel->setSerializer($serializer); $jsonModel->setContext($context); return $jsonModel; }