Skip to content

Commit

Permalink
Merge pull request #36 from Soflomo/feature/add-flash-messages
Browse files Browse the repository at this point in the history
Add flash messages
  • Loading branch information
jurreantonisse committed Oct 17, 2014
2 parents 7dc37b3 + 4bb7eea commit 403c508
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Soflomo/BlogAdmin/Controller/ArticleController.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ public function createAction()
if ($form->isValid()) {
$this->getService()->create($article);

$this->flashMessenger()->addMessage('Article created successfully.');
return $this->redirect()->toRoute('zfcadmin/blog/article/view', array(
'blog' => $blog->getSlug(),
'article' => $article->getId(),
Expand Down Expand Up @@ -183,6 +184,7 @@ public function updateAction()
if ($form->isValid()) {
$this->getService()->update($article);

$this->flashMessenger()->addMessage('Article saved successfully.');
return $this->redirect()->toRoute('zfcadmin/blog/article/update', array(
'blog' => $blog->getSlug(),
'article' => $article->getId(),
Expand Down Expand Up @@ -220,6 +222,7 @@ public function deleteAction()

$service->delete($article);

$this->flashMessenger()->addMessage('Article deleted successfully.');
return $this->redirect()->toRoute('zfcadmin/blog', array(
'blog' => $blog->getSlug(),
));
Expand Down
3 changes: 3 additions & 0 deletions src/Soflomo/BlogAdmin/Controller/CategoryController.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ public function createAction()
if ($form->isValid()) {
$this->getService()->create($category);

$this->flashMessenger()->addMessage('Category created successfully.');
return $this->redirect()->toRoute('zfcadmin/blog/category/view', array(
'blog' => $blog->getSlug(),
'category' => $category->getId(),
Expand Down Expand Up @@ -179,6 +180,7 @@ public function updateAction()
if ($form->isValid()) {
$this->getService()->update($category);

$this->flashMessenger()->addMessage('Category saved successfully.');
return $this->redirect()->toRoute('zfcadmin/blog/category/update', array(
'blog' => $blog->getSlug(),
'category' => $category->getId(),
Expand Down Expand Up @@ -216,6 +218,7 @@ public function deleteAction()

$service->delete($category);

$this->flashMessenger()->addMessage('Category deleted successfully.');
return $this->redirect()->toRoute('zfcadmin/blog', array(
'blog' => $blog->getSlug(),
));
Expand Down

0 comments on commit 403c508

Please sign in to comment.