/** * Create service * * @param ServiceLocatorInterface $serviceLocator * * @return Register */ public function createService(ServiceLocatorInterface $serviceLocator) { /** * @var $filter RegisterInputFilter */ $filter = $serviceLocator->get('Auth\\Form\\RegisterInputFilter'); $config = $serviceLocator->get('Config'); $captchaConfig = isset($config['captcha']) ? $config['captcha'] : array(); $form = new Register(null, array('captcha' => $captchaConfig)); $form->setInputfilter($filter); return $form; }
/** * Create service * * @param ServiceLocatorInterface $serviceLocator * * @return Register */ public function createService(ServiceLocatorInterface $serviceLocator) { /** * @var $serviceLocator \Zend\Form\FormElementManager * @var $filter RegisterInputFilter */ $filter = $serviceLocator->getServiceLocator()->get('Auth\\Form\\RegisterInputFilter'); /* @var $config CaptchaOptions */ $config = $serviceLocator->getServiceLocator()->get('Auth/CaptchaOptions'); $form = new Register(null, $config); $form->setAttribute('id', 'registration'); $form->setInputfilter($filter); return $form; }