/** * 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; }
private function createBaseForm($name) { $f = new AppForm($this, $name); $f->addProtection(); return $f; }
/** * 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; }