Redirect
After that an action has been performed, the operation can be redirected to another operation.
Default redirections
Redirections are configured on your operations with these default behaviours.
create
show
if exists, otherwise index
update
show
if exists, otherwise index
delete
index
bulk_delete
index
Custom redirection
For example, let's configure a custom redirection to create & update operations.
After adding or editing a book, it will be redirected to the edition page of a book.
Pass arguments to your redirection
You can pass arguments to your redirection method.
3 variables are available:
resource
: to retrieve data from the instantiated resource{name_of_your_resource}
: If your resource is a book instance, it will be also available asbook
variablerequest
: to retrieve data from the request via Symfony\Component\HttpFoundation\Request
It uses the Symfony expression language component.
As an example, let's redirect a book creation to the author details page of the created book.
Last updated