Ejemplo n.º 1
0
 public function initialize()
 {
     // Init Parent
     parent::initialize();
     // Password
     $this->addFormElement(['name' => 'password', 'label' => 'Password', 'type' => 'password', 'lazy-set' => ['required-text-field']]);
     // Confirm Password
     $this->addFormElement(['name' => 'confirm_password', 'label' => 'Confirm Password', 'type' => 'password', 'lazy-set' => ['required-text-field', 'identical']]);
 }
Ejemplo n.º 2
0
 public function initialize()
 {
     // Init Parent
     parent::initialize();
     // Placeholder Parameter
     $this->setPlaceholderParameter(':submit-btn-label', 'Sign In');
     // Add Form Elements
     $this->addFormElement(['name' => 'email', 'label' => 'Email', 'type' => 'text']);
     $this->addFormElement(['name' => 'password', 'label' => 'Password', 'type' => 'password']);
 }
Ejemplo n.º 3
0
 public function initialize()
 {
     // Init Parent
     parent::initialize();
     // ServiceManager and ObjectManager
     $sm = $this->getServiceLocator();
     $em = $sm->get('Doctrine\\ORM\\EntityManager');
     $userRepository = $em->getRepository('Oml\\Zf2User\\Entity\\User');
     $this->setPlaceholderParameter(':object-manager', $em);
     $this->setPlaceholderParameter(':object-repository', $userRepository);
     $this->setPlaceholderParameter(':text-element-placeholder', 'Email Address', 'email');
     $this->setPlaceholderParameter(':href-link', Utility::routeNameToUrl($sm, 'om-zf2-user-account-sign-in'));
     //Add Form Element
     $this->addFormElement(['name' => 'email', 'label' => 'Email', 'type' => 'text', 'lazy-set' => ['form-element', 'required-text-field', 'email-address', 'no-record-exist']]);
     $this->addFormElement(['name' => 'href', 'label' => 'Sign In', 'type' => 'Application\\Form\\Element\\Href', 'lazy-set' => ['forgot-password-link']]);
     // Replace Form Element
     $this->replaceFormElement(['name' => 'submit', 'label' => 'Submit', 'type' => 'button', 'lazy-set' => ['sign-in-btn']]);
 }
Ejemplo n.º 4
0
 public function initialize()
 {
     // Init Parent
     parent::initialize();
     // ServiceManager and ObjectManager
     $sm = $this->getServiceLocator();
     $em = $sm->get('Doctrine\\ORM\\EntityManager');
     $userRepository = $em->getRepository('Oml\\Zf2User\\Entity\\User');
     // Set Placeholder Parameter
     $this->setPlaceholderParameter(':object-manager', $em);
     $this->setPlaceholderParameter(':object-repository', $userRepository);
     $this->setPlaceholderParameter(':no-record-exist-fields', 'email');
     $this->setPlaceholderParameter(':submit-btn-label', 'Register');
     // Add Form Elements
     $this->addFormElement(['name' => 'name', 'label' => 'Name', 'type' => 'text', 'lazy-set' => ['required-text-field']]);
     $this->addFormElement(['name' => 'email', 'label' => 'Email', 'type' => 'text', 'lazy-set' => ['required-text-field', 'email-address', 'no-record-exist']]);
     $this->addFormElement(['name' => 'password', 'label' => 'Password', 'type' => 'password', 'lazy-set' => ['required-text-field']]);
     $this->addFormElement(['name' => 'confirm_password', 'label' => 'Confirm Password', 'type' => 'password', 'lazy-set' => ['required-text-field', 'identical']]);
 }