Exemplo n.º 1
0
 function insertFormSucceeded(\Nette\Forms\BootstrapUIForm $form)
 {
     $doc = new \App\Model\Document($this->database);
     $doc->setType(5);
     $doc->createSlug("contact-" . $form->values->name);
     $doc->setTitle($form->values->name);
     $page = $doc->create($this->presenter->user->getId());
     // create new contact
     $this->database->table("contacts")->insert(array("categories_id" => 5, "pages_id" => $page, "users_id" => $this->presenter->user->getId(), "name" => $form->values->name, "street" => $form->values->street, "zip" => $form->values->zip, "city" => $form->values->city));
     $this->presenter->redirect(":Front:Profile:addresses");
 }