has_id()) return sprintf("%s {", $this->get_id()); } protected function paint_attributes() { $r = array(); foreach($this->get_attributes() as $k=>$v) { //$k = strtolower($k); $r[] = "$k: $v;"; } return implode('',$r); } protected function paint_foot() { if ($this->has_id()) return sprintf("};"); } function __toString() { return $this->paint_head().$this->paint_attributes().$this->paint_foot(); } }