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->addCheckbox('remember', 'Remember me on this computer');
     $form->addSubmit('login', 'Login');
     $form->onSubmit[] = callback($this, 'loginFormSubmitted');
     return $form;
 }
Example #2
0
 protected function createPageFormBase($name, $new)
 {
     $form = new AppForm($this, $name);
     if (!$new) {
         $form->addHidden("id");
     }
     $form->addText("name", "Name", 40, 50);
     $form->addTextArea("description", "Description", 40, 3);
     $form->addTextArea("text", "Text", 40, 15);
     $form->addMultiSelect("tags", "Tags", Tag::findAll()->fetchPairs("id", "name"))->setOption("description", Html::el("a")->href($this->link("Tag:"))->setText("Edit tags"));
     $form->addCheckbox("allowed", "Allowed");
     $form->addSubmit("s", "Save");
     return $form;
 }