setOptions($options); } public function setOptions(array $options) { if (array_key_exists('options', $options)) { unset($options['options']); } foreach ($options as $name=> $value) { $method = 'set' . ucfirst($name); if (method_exists($this, $method)) { $this->$method($value); } else { $this->setAttrib($name, $value); } } return $this; } public function getLabel() { return $this->label; } public function setLabel($label) { $this->label = $label; return $this; } public function getAttribs() { return $this->attribs; } public function setAttribs($attribs) { $this->attribs = $attribs; return $this; } public function getAttrib($name) { return $this->attribs[$name]; } public function setAttrib($name, $value) { $this->attribs[$name] = $value; return $this; } }