public function addComponent(SimpleComponent $component, $attachTo, $params)
 {
     if ($this->autoCompile) {
         $this->components[] = $component;
     }
     if (isset($attachTo)) {
         $component->attach($attachTo);
     }
     if (isset($params)) {
         if (is_array($params)) {
             $component->setParams($params);
         }
     }
     return $component;
 }