public function __get($key) { if ($key == 'type' || $key == 'name') { return $this->data[$key]; } elseif ($key == 'html_class') { return $this->key; } else { return parent::__get($key); } }