本文整理汇总了PHP中JControllerLegacy::Redirect方法的典型用法代码示例。如果您正苦于以下问题:PHP JControllerLegacy::Redirect方法的具体用法?PHP JControllerLegacy::Redirect怎么用?PHP JControllerLegacy::Redirect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JControllerLegacy
的用法示例。
在下文中一共展示了JControllerLegacy::Redirect方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: checkout
public function checkout()
{
// set template and params
if (!($this->template = $this->application->getTemplate())) {
return $this->app->error->raiseError(500, JText::_('No template selected'));
}
$this->app->document->addScript('assets:js/formhandler.js');
$step = $this->app->request->get('step', 'string', 'customer');
$layout = 'checkout';
$this->params = $this->application->getParams('site');
// Initialize the Cash Register
$CR = $this->app->cashregister->start();
// Import Transfer Data
if ($step != 'receipt') {
$CR->import();
}
//Setup Page Variables
$page = $CR->page;
// $customer = $this->app->request->get('customer','array');
// $CR->order->billing = $this->app->data->create($customer['billing']);
// $CR->order->shipping = $this->app->data->create($customer['shipping']);
switch ($step) {
case 'customer':
$page->title = 'Customer Information';
$page->subtitle = 'Please enter your information below.';
$page->id = $step;
$page->inProgress = array($step);
$page->addButton('print', '', 'Print', false)->addButton('back', '', 'Back', false)->addButton('proceed', 'payment', 'Proceed');
break;
case 'payment':
$page->title = 'Payment Information';
$page->subtitle = 'Please enter your payment information below.';
$page->id = $step;
$page->complete = array('customer');
$page->inProgress = array($step);
$page->addButton('print', '', '', false)->addButton('back', 'customer', 'Back')->addButton('proceed', 'confirm', 'Proceed');
break;
case 'confirm':
$page->title = 'Order Confirmation';
$page->subtitle = '<span class="uk-text-danger">Please make sure that your order is correct.</span>';
$page->id = $step;
$page->complete = array('customer', 'payment');
$page->inProgress = array($step);
$page->addButton('print', '', '', false)->addButton('back', 'payment', 'Back')->addButton('proceed', 'processPayment', 'Pay Now');
break;
case 'receipt':
$page->title = 'Order Receipt';
$page->subtitle = 'Thank you for your purchase.';
$page->id = $step;
$page->complete = array('customer', 'payment', 'confirm');
$page->inProgress = array($step);
$page->addButton('print', 'Print Receipt')->addButton('back', '', 'Back', false)->addButton('proceed', 'home', 'Return to Home Page');
$this->app->document->addStyleSheet('assets:css/receipt.css');
break;
case 'home':
JControllerLegacy::setRedirect('/');
JControllerLegacy::Redirect();
break;
default:
$page->title = 'Customer Information';
$page->subtitle = 'Please enter your information below.';
$page->id = 'customer';
$page->inProgress = array('customer');
$page->addButton('print', '', 'Print', false)->addButton('back', '', 'Back', false)->addButton('proceed', 'payment', 'Proceed');
}
$this->CashRegister = $CR;
// display view
$this->getView()->addTemplatePath($this->template->getPath())->setLayout($layout)->display();
}