public function create()
 {
     $form = new Form();
     $form->addGroup("Set base title");
     $form->addText("baseTitle", "Base title:");
     $form->addSubmit("send", "Set base title");
     $form->onSuccess[] = $this->processForm;
     $form->setDefaults(array("baseTitle" => $this->settingsDao->getBaseTitle()));
     return $form;
 }
 public function render()
 {
     $target = $this->currentTarget->getCurrentTarget();
     $meta = $target && $target->getMeta() ? $target->meta : NULL;
     $this->template->setFile(__DIR__ . "/MetaTags.latte");
     $targetTitle = $meta ? $meta->seoTitle : NULL;
     $baseTitle = $this->settingsDao->getBaseTitle();
     if ($baseTitle and $targetTitle) {
         $title = $targetTitle . " - " . $baseTitle;
     } else {
         $title = $targetTitle . $baseTitle;
     }
     $this->template->title = $title;
     $this->template->keywords = $meta ? $meta->seoKeywords : NULL;
     $this->template->description = $meta ? $meta->seoDescription : NULL;
     $this->template->robots = $meta ? $meta->seoRobots : NULL;
     $this->template->render();
 }