Skip to content
This repository has been archived by the owner on Nov 27, 2020. It is now read-only.

Commit

Permalink
Merge pull request #34 from stefliekens/redirect-delete
Browse files Browse the repository at this point in the history
Redirect after delete action
  • Loading branch information
veewee committed Sep 13, 2015
2 parents f6bbb72 + cdfad6f commit 2e7c6dc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Phpro/SmartCrud/Controller/CrudController.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,10 @@ public function readAction()
*/
public function deleteAction()
{
$data = $this->getRequest()->isPost() ? $this->getRequest()->getPost() : null;
$request = $this->getRequest();
$data = $request->isPost() ? $request->getPost() : null;
$result = $this->getSmartService()->run($this->getEntityId(), $data);
if ($this->getRequest()->isPost() && $result->isSuccessFull()) {
if (($request->isPost() && !$request->isXmlHttpRequest()) && $result->isSuccessFull()) {
return $this->redirect()->toRoute(null, array('action' => 'list'), true);
}
return $this->getViewModelBuilder()->build($this->getRequest(), $result, 'delete');
Expand Down

0 comments on commit 2e7c6dc

Please sign in to comment.