merge route params in crud admin redirects
This commit is contained in:
parent
661840d87c
commit
0af04c9131
|
@ -68,9 +68,10 @@ abstract class CrudController extends AdminController
|
||||||
$entityManager->create($entity);
|
$entityManager->create($entity);
|
||||||
$this->addFlash('success', 'The data has been saved.');
|
$this->addFlash('success', 'The data has been saved.');
|
||||||
|
|
||||||
return $this->redirectToRoute($configuration->getPageRoute('edit'), [
|
return $this->redirectToRoute($configuration->getPageRoute('edit'), array_merge(
|
||||||
'entity' => $entity->getId(),
|
['entity' => $entity->getId()],
|
||||||
]);
|
$configuration->getPageRouteParams('edit')
|
||||||
|
));
|
||||||
}
|
}
|
||||||
$this->addFlash('warning', 'The form is not valid.');
|
$this->addFlash('warning', 'The form is not valid.');
|
||||||
}
|
}
|
||||||
|
@ -111,9 +112,10 @@ abstract class CrudController extends AdminController
|
||||||
$entityManager->update($entity);
|
$entityManager->update($entity);
|
||||||
$this->addFlash('success', 'The data has been saved.');
|
$this->addFlash('success', 'The data has been saved.');
|
||||||
|
|
||||||
return $this->redirectToRoute($configuration->getPageRoute('edit'), [
|
return $this->redirectToRoute($configuration->getPageRoute('edit'), array_merge(
|
||||||
'entity' => $entity->getId(),
|
['entity' => $entity->getId()],
|
||||||
]);
|
$configuration->getPageRouteParams('edit')
|
||||||
|
));
|
||||||
}
|
}
|
||||||
$this->addFlash('warning', 'The form is not valid.');
|
$this->addFlash('warning', 'The form is not valid.');
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue