public function __construct($attributes = '') { // assume non-array is legend if (!is_array($attributes)) { $attributes = array('legend' => $attributes); } // handle legend if (array_key_exists('legend', $attributes)) { if (!$attributes['legend'] instanceof Legend) { $attributes['legend'] = new Legend($attributes['legend']); } $this->setChild($attributes['legend']); unset($attributes['legend']); } // set all attributes $this->setAttributes($attributes); parent::__construct(); }
public function __toString() { if (!empty($_POST) && !$this->_validationRan) { $this->runValidation(); } return parent::__toString(); }