Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

symfony redirect to previous page

/**
 * @Route ("/cart/add/{id}", name = "add_cart")
 */
public function add($id, CartService $cartservice, Request $request){
    $cartservice->add($id);

    $route = $request->headers->get('referer');

    return $this->redirect($route);
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #symfony #redirect #previous #page
ADD COMMENT
Topic
Name
8+5 =