/**
  * Generates control's HTML element.
  */
 public function getControl()
 {
     $input = parent::getControl();
     if ($this->path) {
         $this->template->pathName = $this->getHtmlName() . "-path";
         $this->template->path = $this->path;
         $this->template->setFile(__DIR__ . "/templates/edit.latte");
     } else {
         $this->template->setFile(__DIR__ . "/templates/add.latte");
     }
     $this->template->removedName = $this->getHtmlName() . "-removed";
     $this->template->input = $input;
     $this->template->_form = $this->getForm();
     return Html::el()->add((string) $this->template);
 }