示例#1
0
 public function settingsFormSucceeded(UI\Form $form, Nette\Utils\ArrayHash $vals)
 {
     try {
         $this->settings->save($vals);
         $this->presenter->flashMessage('Změny jsou úspěšně uloženy.', 'success');
         $this->onSave();
     } catch (Nette\Security\AuthenticationException $exc) {
         $this->presenter->flashMessage('Myslím to vážně, editovat opravdu **ne**můžete!', 'danger');
         $this->redirect('this');
         return;
     }
 }
示例#2
0
 public function startup()
 {
     parent::startup();
     $this->template->setting = $this->setting = $this->settings->findAllByKeys();
     $this->template->pages = $this->pages->findBy([]);
 }