Esempio n. 1
0
 /**
  * Creates an object representation of a html form.
  */
 public function createForm($action)
 {
     $this->form = new Form();
     $label = new Field\Label();
     $input = new Field\Input();
     $submit = new Field\Submit();
     $label->setMessage('Enter coordinates (row, col), e.g. A5');
     $input->setSize(5);
     $input->setName('coord');
     $submit->setName('submit');
     $this->form->addField($label);
     $this->form->addField($input);
     $this->form->addField($submit);
     $this->form->setPostMethod();
     $this->form->setAction($action);
     $this->form->loadDataSubmitted();
 }
Esempio n. 2
0
 /**
  * Converts an object Field\Label in its html representation.
  *
  * @param Field\Label $label
  * @return string
  */
 public function toString(Field\Label $label)
 {
     return "{$label->getMessage()}";
 }