public function CartController::removeFromCart in Basic cart 8
Same name and namespace in other branches
- 8.6 src/Controller/CartController.php \Drupal\basic_cart\Controller\CartController::removeFromCart()
- 8.0 src/Controller/CartController.php \Drupal\basic_cart\Controller\CartController::removeFromCart()
- 8.2 src/Controller/CartController.php \Drupal\basic_cart\Controller\CartController::removeFromCart()
- 8.3 src/Controller/CartController.php \Drupal\basic_cart\Controller\CartController::removeFromCart()
- 8.4 src/Controller/CartController.php \Drupal\basic_cart\Controller\CartController::removeFromCart()
- 8.5 src/Controller/CartController.php \Drupal\basic_cart\Controller\CartController::removeFromCart()
1 string reference to 'CartController::removeFromCart'
File
- src/
Controller/ CartController.php, line 48 - Contains \Drupal\basic_cart\Controller\CartController.
Class
- CartController
- Contains the cart controller.
Namespace
Drupal\basic_cart\ControllerCode
public function removeFromCart($nid) {
\Drupal::service('page_cache_kill_switch')
->trigger();
$cart = Utility::removeFromCart($nid);
return new RedirectResponse(Url::fromUri($_SERVER['HTTP_REFERER'])
->toString());
}