/** * Create Service Factory * * @param ServiceLocatorInterface $serviceLocator */ public function createService(ServiceLocatorInterface $serviceLocator) { $inputFilterManager = $serviceLocator->get('InputFilterManager'); $form = new UserForm('login'); $form->addCsrfElement(); $form->addEmailElement(); $form->addPassElement(); $form->addSubmitElement('login', 'Einloggen'); $form->setInputFilter($inputFilterManager->get('User\\Filter\\User')); $form->setValidationGroup(array('email', 'pass', 'login')); return $form; }
/** * Create Service Factory * * @param ServiceLocatorInterface $serviceLocator */ public function createService(ServiceLocatorInterface $serviceLocator) { $inputFilterManager = $serviceLocator->get('InputFilterManager'); $form = new UserForm('register'); $form->addCsrfElement(); $form->addEmailElement(); $form->addPassElement(); $form->addFirstnameElement(); $form->addLastnameElement(); $form->addSubmitElement('save', 'Speichern'); $form->addSubmitElement('cancel', 'Abbrechen'); $form->setInputFilter($inputFilterManager->get('User\\Filter\\User')); $form->setValidationGroup(array('email', 'pass', 'firstname', 'lastname', 'save', 'cancel')); return $form; }
/** * Create Service Factory * * @param ServiceLocatorInterface $serviceLocator */ public function createService(ServiceLocatorInterface $serviceLocator) { $inputFilterManager = $serviceLocator->get('InputFilterManager'); $userEntity = $serviceLocator->get('User\\Entity\\User'); $roleOptions = $userEntity->getRoleNames(); $form = new UserForm('update'); $form->addIdElement(); $form->addCsrfElement(); $form->addRoleElement($roleOptions); $form->addEmailElement(); $form->addPassElement(); $form->addFirstnameElement(); $form->addLastnameElement(); $form->addSubmitElement('save', 'Speichern'); $form->addSubmitElement('cancel', 'Abbrechen'); $form->setInputFilter($inputFilterManager->get('User\\Filter\\User')); $form->setValidationGroup(array('id', 'role', 'email', 'pass', 'firstname', 'lastname', 'save', 'cancel')); return $form; }