@@ -87,10 +87,10 @@ public function newAction(Request $request)
87
87
$ em ->persist ($ post );
88
88
$ em ->flush ();
89
89
90
- // Add a flash message to user
91
- // $this->addFlash is equivalent to $this->get('session')->getFlashBag()->add
90
+ // Flash messages are used to notify the user about the result of the
91
+ // actions. They only last as long as the next request.
92
92
// See http://symfony.com/doc/current/book/controller.html#flash-messages
93
- $ this ->addFlash ('post.created_successfully ' , 'post.created_successfully ' );
93
+ $ this ->addFlash ('success ' , 'post.created_successfully ' );
94
94
95
95
return $ this ->redirectToRoute ('admin_post_index ' );
96
96
}
@@ -147,7 +147,7 @@ public function editAction(Post $post, Request $request)
147
147
$ post ->setSlug ($ this ->get ('slugger ' )->slugify ($ post ->getTitle ()));
148
148
$ em ->flush ();
149
149
150
- $ this ->addFlash ('post.updated_successfully ' , 'post.updated_successfully ' );
150
+ $ this ->addFlash ('success ' , 'post.updated_successfully ' );
151
151
152
152
return $ this ->redirectToRoute ('admin_post_edit ' , array ('id ' => $ post ->getId ()));
153
153
}
@@ -181,7 +181,7 @@ public function deleteAction(Request $request, Post $post)
181
181
$ em ->remove ($ post );
182
182
$ em ->flush ();
183
183
184
- $ this ->addFlash ('post.deleted_successfully ' , 'post.deleted_successfully ' );
184
+ $ this ->addFlash ('success ' , 'post.deleted_successfully ' );
185
185
}
186
186
187
187
return $ this ->redirectToRoute ('admin_post_index ' );
0 commit comments