function insertFormSucceeded(\Nette\Forms\BootstrapUIForm $form) { $doc = new \App\Model\Document($this->database); $doc->setType($form->values->type); $doc->setTitle($form->values->title); $doc->setPreview($form->values->preview); $page = $doc->create($this->presenter->user->getId(), $form->values->category); \App\Model\IO::directoryMake(APP_DIR . '/media/' . $page); $this->presenter->redirect(this, array("id" => $form->values->category, "type" => $form->values->type)); }