public function addChild(\McGowan\HTML\Views\Element $field) { if (!$field instanceof \McGowan\Form\Fields\Views\Field) { throw new \Exception('Only type \\McGowan\\Form\\Fields\\Views\\Field can be added as a child of type Form.'); } return parent::addChild($field); }
/** * @see Element::beforeRender */ protected function beforeRender() { /* Do not render the label if the inner text value is empty. */ $label_val = $this->_label->text()->value(); if (!empty($label_val)) { parent::addChild($this->_label); } parent::addChild($this->_element); parent::beforeRender(); }