當前位置: 首頁>>代碼示例>>PHP>>正文


PHP JControllerLegacy::Redirect方法代碼示例

本文整理匯總了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();
 }
開發者ID:camigreen,項目名稱:ttop,代碼行數:69,代碼來源:store.php


注:本文中的JControllerLegacy::Redirect方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。