Exemplo n.º 1
0
 /**
  * Retrieve the HTML code used to display this field.
  * @param array $extraParams to be set in the template overwriting existing params.
  */
 function getHtml()
 {
     if (!$this->field_type) {
         throw new Exception("No field type defined.");
     }
     // Load the appropriate field template.
     $fieldTemplate = "field_" . str_replace(" ", "_", $this->field_type) . ".phtml";
     $t = new FBTemplatizer($fieldTemplate);
     if (!$t->exists()) {
         unset($t);
         $fieldTemplate = "field_single_line_text_box.phtml";
         $t = new FBTemplatizer($fieldTemplate);
     }
     $t->set('ERROR', $this->getError());
     $t->set('NAME', $this->getName());
     $t->set('LABEL', $this->getLabel());
     $t->set('TYPE', str_replace(" ", "", $this->getType()));
     $t->set('HELPTEXT', $this->getHelp());
     $t->set('VALUE', $this->getValue());
     $html = $t->parse();
     return $html;
 }