当前位置: 首页>>代码示例>>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;未经允许,请勿转载。