Redirect
Last updated
Last updated
After that an action has been performed, the operation can be redirected to another operation.
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
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.
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 as book
variable
request
: to retrieve data from the request via Symfony\Component\HttpFoundation\Request
As an example, let's redirect a book creation to the author details page of the created book.
It uses the component.