예제 #1
0
 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();
 }
예제 #2
0
 public function __toString()
 {
     if (!empty($_POST) && !$this->_validationRan) {
         $this->runValidation();
     }
     return parent::__toString();
 }