Пример #1
0
 /**
  * @param \App\Forms\ArticleForm $form
  */
 public function articleFormSubmitted(ArticleForm $form)
 {
     $article = $form->getValues(TRUE);
     if ($this->action == 'add') {
         $article['published'] = new \DateTime();
     } else {
         $article['id'] = $this->getParameter('id');
     }
     $this->articleModel->save($article);
     $this->flashMessage('Článok bol úspešne uložený.', 'success');
     $this->redirect('default', $article['id']);
 }