Example #1
0
 /**
  * Login form component factory.
  * @return mixed
  */
 protected function createComponentLoginForm()
 {
     $form = new AppForm();
     $form->addText('username', 'Username:'******'Please provide a username.');
     $form->addPassword('password', 'Password:'******'Please provide a password.');
     $form->addSubmit('login', 'Login');
     $form->addProtection('Please submit this form again (security token has expired).');
     $form->onSubmit[] = callback($this, 'loginFormSubmitted');
     return $form;
 }
Example #2
0
 private function createBaseForm($name)
 {
     $f = new AppForm($this, $name);
     $f->addProtection();
     return $f;
 }
Example #3
0
 /**
  * Album delete form component factory.
  * @return mixed
  */
 protected function createComponentDeleteForm()
 {
     $form = new AppForm();
     $form->addSubmit('cancel', 'Cancel');
     $form->addSubmit('delete', 'Delete')->setAttribute('class', 'default');
     $form->onSubmit[] = callback($this, 'deleteFormSubmitted');
     $form->addProtection('Please submit this form again (security token has expired).');
     return $form;
 }