Exemple #1
0
 /**
  * Makes sure that alle Field Displays are updated before a string
  * representation of the Form containing those Fields are returned
  * 
  * @return string
  */
 public function __toString()
 {
     foreach ($this->dataSource->getFields() as $field) {
         $field->refreshDisplay();
         /* Make sure that all hidden fields will be displayed somewhere */
         if ($field instanceof \Feeld\Field\CommonProperties\IdentifierInterface && $field->hasId() && is_null($this->getChildById($field->getId()))) {
             $fieldDisplay = $field->getDisplay();
             if ($fieldDisplay instanceof Input && isset($fieldDisplay->attributes['type']) && $fieldDisplay->attributes['type'] === 'hidden') {
                 $this->prependChild($field->getDisplay());
             }
         }
     }
     return parent::__toString();
 }