当前位置: 首页>>代码示例>>PHP>>正文


PHP Am_Controller::getRequest方法代码示例

本文整理汇总了PHP中Am_Controller::getRequest方法的典型用法代码示例。如果您正苦于以下问题:PHP Am_Controller::getRequest方法的具体用法?PHP Am_Controller::getRequest怎么用?PHP Am_Controller::getRequest使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Am_Controller的用法示例。


在下文中一共展示了Am_Controller::getRequest方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: process

 /**
  * This function is likely never returns
  * but anyway handle result and exceptions
  * @return Am_Paysystem_Result
  */
 function process()
 {
     $err = $this->invoice->validate();
     if ($err) {
         throw new Am_Exception_InputError($err[0]);
     }
     $this->invoice->save();
     $plugin = Am_Di::getInstance()->plugins_payment->loadGet($this->invoice->paysys_id);
     $this->result = new Am_Paysystem_Result();
     $plugin->processInvoice($this->invoice, $this->controller->getRequest(), $this->result);
     if ($this->result->isSuccess() || $this->result->isFailure()) {
         if ($transaction = $this->result->getTransaction()) {
             $transaction->setInvoice($this->invoice);
             $transaction->process();
         }
     }
     if ($this->result->isSuccess()) {
         $url = REL_ROOT_URL . "/thanks?id=" . $this->invoice->getSecureId('THANKS');
         $this->callback($this->onSuccess);
         $this->controller->redirectLocation($url, ___("Invoice processed"), ___("Invoice processed successfully"));
         // no return Am_Exception_Redirect
     } elseif ($this->result->isAction()) {
         $this->callback($this->onAction);
         $this->result->getAction()->process($this->controller);
         // no return Am_Exception_Redirect
     } else {
         //  ($result->isFailure()) {
         $this->callback($this->onFailure);
     }
     return $this->result;
 }
开发者ID:subashemphasize,项目名称:test_site,代码行数:36,代码来源:PayProcessMediator.php

示例2: process

 /**
  * This function is likely never returns
  * but anyway handle result and exceptions
  * @return Am_Paysystem_Result
  */
 function process()
 {
     Am_Di::getInstance()->hook->call(Am_Event::INVOICE_BEFORE_PAYMENT, array('invoice' => $this->invoice, 'controller' => $this->controller));
     $plugin = Am_Di::getInstance()->plugins_payment->loadGet($this->invoice->paysys_id);
     $this->result = new Am_Paysystem_Result();
     $plugin->processInvoice($this->invoice, $this->controller->getRequest(), $this->result);
     if ($this->result->isSuccess() || $this->result->isFailure()) {
         if ($transaction = $this->result->getTransaction()) {
             $transaction->setInvoice($this->invoice);
             $transaction->process();
         }
     }
     if ($this->result->isSuccess()) {
         if (method_exists($this->controller, 'getForm')) {
             $this->controller->getForm()->getSessionContainer()->destroy();
         }
         $url = REL_ROOT_URL . "/thanks?id=" . $this->invoice->getSecureId('THANKS');
         $this->callback($this->onSuccess);
         $this->controller->redirectLocation($url);
         // no return
         // Am_Exception_Redirect only for APPLICATION_ENV = 'testing'
     } elseif ($this->result->isAction()) {
         if (method_exists($this->controller, 'getForm')) {
             $this->controller->getForm()->getSessionContainer()->destroy();
         }
         $this->callback($this->onAction);
         $this->result->getAction()->process($this->controller);
         // no return
         // Am_Exception_Redirect only for APPLICATION_ENV = 'testing'
     } else {
         //  ($result->isFailure()) {
         $this->callback($this->onFailure);
     }
     return $this->result;
 }
开发者ID:irovast,项目名称:eyedock,代码行数:40,代码来源:PayProcessMediator.php

示例3: directAction

 function directAction(Am_Request $request, Zend_Controller_Response_Http $response, array $invokeArgs)
 {
     if (!$this->getDi()->auth->getUserId() || !($invoice_id = $this->getDi()->auth->getUser()->data()->get(self::NEED_SHOW_OTO))) {
         throw new Am_Exception_InternalError();
     }
     $user = $this->getDi()->auth->getUser();
     $invoice = $this->getDi()->invoiceTable->load($invoice_id);
     $controller = new Am_Controller($request, $response, $invokeArgs);
     // find first matching upsell
     $oto = $this->getDi()->otoTable->findUpsell($invoice->getProducts());
     if ($controller->getRequest()->get('oto') == 'no') {
         $oto = $this->getDi()->otoTable->findDownsell($invoice->data()->get(self::LAST_OTO_SHOWN));
     }
     if (!$oto) {
         $user->data()->set(self::NEED_SHOW_OTO, null)->update();
         Am_Controller::redirectLocation(REL_ROOT_URL);
     }
     if ($controller->getRequest()->get('oto') == 'yes') {
         $user->data()->set(self::NEED_SHOW_OTO, null)->update();
         return $this->yesOto($controller, $invoice, $this->getDi()->otoTable->load($invoice->data()->get(self::LAST_OTO_SHOWN)));
     }
     $invoice->data()->set(self::LAST_OTO_SHOWN, $oto->pk())->update();
     $html = $oto->render();
     $controller->getResponse()->setBody($html);
     throw new Am_Exception_Redirect();
 }
开发者ID:alexanderTsig,项目名称:arabic,代码行数:26,代码来源:oto.php

示例4: createBasketController

 public function createBasketController($id, $title, Am_Controller $controller)
 {
     return new AdminCartHtmlGenerateController_Basket($controller->getRequest(), $controller->getResponse(), $this->_invokeArgs);
 }
开发者ID:grlf,项目名称:eyedock,代码行数:4,代码来源:AdminShoppingCartController.php

示例5: createSavedController

 public function createSavedController($id, $title, Am_Controller $controller)
 {
     return new AdminReportsController_Saved($controller->getRequest(), $controller->getResponse(), $this->_invokeArgs);
 }
开发者ID:grlf,项目名称:eyedock,代码行数:4,代码来源:AdminReportsController.php


注:本文中的Am_Controller::getRequest方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。