Ejemplo n.º 1
0
 public function addComponent(Component $component)
 {
     if ($component instanceof Field) {
         $component->setFieldComponentRenderer($this->defaultFieldComponentRenderer);
     }
     parent::addComponent($component);
 }
Ejemplo n.º 2
0
 public function getFormIdentifierAsString()
 {
     $multiBraces = $this->index !== null ? '[' . $this->index . ']' : null;
     if ($this->parentComponent === null || $this->parentComponent instanceof Form) {
         return $this->getName() . $multiBraces;
     }
     return $this->parentComponent->getFormIdentifierAsString() . '[' . $this->getName() . ']' . $multiBraces;
 }
Ejemplo n.º 3
0
 /**
  * Connects a component with the form handler instance
  * @param Component $component The form component to add
  */
 public function addComponent(Component $component)
 {
     $component->setParentComponent($this);
     $component->setFormComponent($this->formComponent);
     $this->components[$component->getName()] = $component;
     // Set value if there is one
     $component->setRequestData(is_array($this->inputData) && array_key_exists($component->getName(), $this->inputData) ? $this->inputData[$component->getName()] : null);
 }
Ejemplo n.º 4
0
 /**
  * @param string $name The name of the field in the HTTP request
  * @param string $label The label of the field
  * @param array $ruleSet
  */
 public function __construct($name, $label, array $ruleSet = array())
 {
     parent::__construct($name);
     $this->id = $name;
     $this->label = $label;
     $this->ruleSet = $ruleSet;
     $this->errors = array();
     $this->validated = false;
     $this->value = null;
     $this->linkedLabel = true;
     $this->fieldComponentRenderer = new DefaultFieldComponentRenderer();
 }