Esempio n. 1
0
 /**
  * Make the form for the page
  * @return \Foundation\Form
  */
 protected function makeForm()
 {
     $form = new \Foundation\Form();
     $form->setAction($this->_controller->getActionPath());
     $field = $form->newField();
     $field->setLegend($this->_applicationPage->getTitle());
     $field->setInstructions($this->_applicationPage->getInstructions());
     foreach ($this->_applicationPage->getPage()->getElements() as $element) {
         $element->getJazzeeElement()->setController($this->_controller);
         $element->getJazzeeElement()->addToField($field);
     }
     $form->newButton('submit', 'Save');
     return $form;
 }
Esempio n. 2
0
 public function getForm()
 {
     if (is_null($this->_form)) {
         $this->_form = new \Foundation\Form();
         $this->_form->setCSRFToken($this->_controller->getCSRFToken());
         $this->_form->setAction($this->_controller->getActionPath());
         $field = $this->_form->newField();
         $field->setLegend($this->_applicationPage->getTitle());
         $field->setInstructions($this->_applicationPage->getInstructions());
         $element = $field->newElement('RadioList', 'lock');
         $element->setLabel('Do you wish to lock your application?');
         $element->newItem(0, 'No');
         $element->newItem(1, 'Yes');
         $element->addValidator(new \Foundation\Form\Validator\NotEmpty($element));
         $this->_form->newButton('submit', 'Submit Application');
     }
     return $this->_form;
 }
Esempio n. 3
0
 /**
  * Make the form for the page
  * @return \Foundation\Form
  */
 public function makeForm()
 {
     $form = new \Foundation\Form();
     $form->setCSRFToken($this->_controller->getCSRFToken());
     $form->setAction($this->_controller->getActionPath());
     $field = $form->newField();
     $field->setLegend($this->_applicationPage->getTitle());
     $field->setInstructions($this->_applicationPage->getInstructions());
     $element = $field->newElement('TextInput', 'externalId');
     $element->setLabel($this->_applicationPage->getPage()->getVar('externalIdLabel'));
     $element->setValue($this->_applicant->getExternalId());
     $element->addValidator(new \Foundation\Form\Validator\NotEmpty($element));
     $element->addValidator(new \Foundation\Form\Validator\SpecialObject($element, array('object' => $this->_applicationPage->getApplication(), 'method' => 'validateExternalId', 'errorMessage' => 'This is not a valid External ID.')));
     $form->newButton('submit', 'Save');
     return $form;
 }