本文整理匯總了PHP中Basket::removeEvent方法的典型用法代碼示例。如果您正苦於以下問題:PHP Basket::removeEvent方法的具體用法?PHP Basket::removeEvent怎麽用?PHP Basket::removeEvent使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Basket
的用法示例。
在下文中一共展示了Basket::removeEvent方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: redirect
use libAllure\Sanitizer;
use libAllure\DatabaseFactory;
if (!Session::isLoggedIn()) {
redirect('login.php', 'You need to <a href = "login.php">login</a> or <a href = "register.php">register</a> to pay for events.');
}
$sanitizer = new Sanitizer();
$action = $sanitizer->filterString('action');
if (isset($_REQUEST['event'])) {
$eventId = intval($_REQUEST['event']);
$event = Events::getById($eventId);
switch ($action) {
case 'addPersonal':
Basket::addEvent($event);
redirect('basket.php', 'Ticked added', false, 1);
case 'delete':
Basket::removeEvent($event, $_REQUEST['user']);
redirect('basket.php', 'Ticket removed', false, -1);
}
}
$signupableEvents = Events::getSignupableEvents();
$tpl->assign('signupableEvents', $signupableEvents);
$formAddToBasket = new FormAddToBasket($signupableEvents);
if ($formAddToBasket->validate()) {
$formAddToBasket->process();
redirect('basket.php', 'Ticket added to basket');
}
$tpl->assign('addToBasketHasEvents', $formAddToBasket->hasEvents);
$tpl->assignForm($formAddToBasket, 'addToBasket');
$formPayForFriend = new FormPayForFriend($signupableEvents);
if ($formPayForFriend->validate()) {
$formPayForFriend->process();