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


PHP Context::getRequest方法代碼示例

本文整理匯總了PHP中Magento\Framework\App\Action\Context::getRequest方法的典型用法代碼示例。如果您正苦於以下問題:PHP Context::getRequest方法的具體用法?PHP Context::getRequest怎麽用?PHP Context::getRequest使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Magento\Framework\App\Action\Context的用法示例。


在下文中一共展示了Context::getRequest方法的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: afterExecute

 public function afterExecute($controller, $result)
 {
     if ($result instanceof \Magento\Framework\View\Result\Page && $this->helper->isEnabledOnFrontend() && $this->helper->getNavToSearch()) {
         $categoryId = $this->context->getRequest()->getParam('id');
         if (!$this->helper->isCategoryIdBlacklisted($categoryId)) {
             $result->getConfig()->setPageLayout('1column');
         }
     }
     return $result;
 }
開發者ID:CelebrosLtd,項目名稱:M2_ConversionPro,代碼行數:10,代碼來源:OneColumnLayout.php

示例2: afterGetButtonList

 public function afterGetButtonList(\Magento\Backend\Block\Widget\Context $subject, \Magento\Backend\Block\Widget\Button\ButtonList $buttonList)
 {
     $request = $this->_context->getRequest();
     if ($request->getFullActionName() == 'sales_order_view') {
         $order = $this->getOrder();
         if ($order && $order->getState() == 'canceled') {
             $message = __('Are you sure you want to un-cancel this order?');
             $buttonList->add('order_uncancel', ['label' => __('Un-Cancel'), 'onclick' => "confirmSetLocation('{$message}', '" . $this->getUnCancelUrl() . "')"]);
         }
     }
     return $buttonList;
 }
開發者ID:Genmato,項目名稱:M2_UnCancelOrder,代碼行數:12,代碼來源:Context.php

示例3: execute

 public function execute()
 {
     $resultRedirect = $this->resultRedirectFactory->create();
     $payuplOrderId = $this->context->getRequest()->getParam('id');
     $orderId = $this->paymentHelper->getOrderIdIfCanRepeat($payuplOrderId);
     if ($orderId) {
         $resultRedirect->setPath('orba_payupl/payment/repeat_start');
         $this->session->setLastOrderId($orderId);
     } else {
         $resultRedirect->setPath('orba_payupl/payment/repeat_error');
         $this->messageManager->addError(__('The repeat payment link is invalid.'));
     }
     return $resultRedirect;
 }
開發者ID:tozwierz,項目名稱:magento2_payupl,代碼行數:14,代碼來源:Repeat.php

示例4: __construct

 /**
  * @param \Magento\Framework\App\Action\Context $context
  */
 public function __construct(\Magento\Framework\App\Action\Context $context)
 {
     $this->_request = $context->getRequest();
     $this->_response = $context->getResponse();
     $this->resultRedirectFactory = $context->getResultRedirectFactory();
     $this->resultFactory = $context->getResultFactory();
 }
開發者ID:whoople,項目名稱:magento2-testing,代碼行數:10,代碼來源:AbstractAction.php

示例5: __construct

 /**
  * @param \Magento\Framework\App\Action\Context $context
  * @param PhpCookieManager $cookieManager
  * @param CookieMetadataFactory $cookieMetadataFactory
  */
 public function __construct(\Magento\Framework\App\Action\Context $context, PhpCookieManager $cookieManager, CookieMetadataFactory $cookieMetadataFactory)
 {
     $this->cookieManager = $cookieManager;
     $this->cookieMetadataFacory = $cookieMetadataFactory;
     $this->_response = $context->getResponse();
     $this->request = $context->getRequest();
 }
開發者ID:pradeep-wagento,項目名稱:magento2,代碼行數:12,代碼來源:CookieTester.php

示例6: __construct

 /**
  * @param Context $context
  */
 public function __construct(Context $context)
 {
     $this->_request = $context->getRequest();
     $this->_response = $context->getResponse();
     $this->resultRedirectFactory = $context->getResultRedirectFactory();
     $this->resultFactory = $context->getResultFactory();
 }
開發者ID:Doability,項目名稱:magento2dev,代碼行數:10,代碼來源:AbstractAction.php

示例7: __construct

 /**
  * AjaxPlugin constructor.
  * @param Context $context
  * @param \Boxalino\Intelligence\Helper\Data $bxHelperData
  * @param \Boxalino\Intelligence\Helper\P13n\Adapter $p13nHelper
  * @param AutocompleteInterface $autocomplete
  * @param \Boxalino\Intelligence\Helper\Autocomplete $autocompleteHelper
  */
 public function __construct(Context $context, \Boxalino\Intelligence\Helper\Data $bxHelperData, \Boxalino\Intelligence\Helper\P13n\Adapter $p13nHelper, \Boxalino\Intelligence\Helper\Autocomplete $autocompleteHelper)
 {
     $this->autocompleteHelper = $autocompleteHelper;
     $this->url = $context->getUrl();
     $this->request = $context->getRequest();
     $this->p13nHelper = $p13nHelper;
     $this->resultFactory = $context->getResultFactory();
     $this->bxHelperData = $bxHelperData;
 }
開發者ID:boxalino,項目名稱:plugin-magento2,代碼行數:17,代碼來源:AjaxPlugin.php

示例8: __construct

 /**
  * @param PaymentHelper $paymentHelper
  */
 public function __construct(\Magento\Framework\App\Action\Context $context, PaymentHelper $paymentHelper, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Checkout\Model\Session $checkoutSession, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Framework\View\Asset\Repository $assetRepo)
 {
     $this->_request = $context->getRequest();
     $this->methodInstance = $paymentHelper->getMethodInstance($this->methodCode);
     $this->_scopeConfig = $scopeConfig;
     $this->_checkoutSession = $checkoutSession;
     $this->_storeManager = $storeManager;
     $this->_assetRepo = $assetRepo;
     $this->_context = $context;
 }
開發者ID:SummaSolutions,項目名稱:cart-magento2,代碼行數:13,代碼來源:CustomConfigProvider.php

示例9: __construct

 /**
  * @param Context $context
  */
 public function __construct(Context $context)
 {
     parent::__construct($context->getRequest(), $context->getResponse());
     $this->_objectManager = $context->getObjectManager();
     $this->_eventManager = $context->getEventManager();
     $this->_url = $context->getUrl();
     $this->_actionFlag = $context->getActionFlag();
     $this->_redirect = $context->getRedirect();
     $this->_view = $context->getView();
     $this->messageManager = $context->getMessageManager();
 }
開發者ID:shabbirvividads,項目名稱:magento2,代碼行數:14,代碼來源:Action.php

示例10: execute

 public function execute()
 {
     /**
      * @var $client \Orba\Payupl\Model\Client
      */
     $request = $this->context->getRequest();
     try {
         $client = $this->clientFactory->create();
         $response = $client->orderConsumeNotification($request);
         $clientOrderHelper = $client->getOrderHelper();
         if ($clientOrderHelper->canProcessNotification($response['payuplOrderId'])) {
             return $clientOrderHelper->processNotification($response['payuplOrderId'], $response['status'], $response['amount']);
         }
     } catch (LocalizedException $e) {
         $this->logger->critical($e);
     }
     /**
      * @var $resultForward \Magento\Framework\Controller\Result\Forward
      */
     $resultForward = $this->resultForwardFactory->create();
     $resultForward->forward('noroute');
     return $resultForward;
 }
開發者ID:ORBA,項目名稱:magento2_payupl,代碼行數:23,代碼來源:Notify.php

示例11: execute

 public function execute(\Magento\Framework\Event\Observer $observer)
 {
     if (!$this->helper->isEnabledOnFrontend()) {
         return;
     }
     $layoutUpdate = $observer->getEvent()->getLayout()->getUpdate();
     $fullActionName = $observer->getEvent()->getFullActionName();
     switch ($fullActionName) {
         case 'catalogsearch_result_index':
             $layoutUpdate->addHandle('conversionpro_catalogsearch_result_index');
             break;
         case 'catalog_category_view':
             if ($this->helper->getNavToSearch()) {
                 $categoryId = $this->context->getRequest()->getParam('id');
                 if (!$this->helper->isCategoryIdBlacklisted($categoryId)) {
                     $layoutUpdate->addHandle('conversionpro_catalog_category_view');
                     if ($this->helper->getHideContent()) {
                         $layoutUpdate->addHandle('conversionpro_catalog_category_view_hide_content');
                     }
                 }
             }
             break;
     }
 }
開發者ID:CelebrosLtd,項目名稱:M2_ConversionPro,代碼行數:24,代碼來源:AddLayoutHandles.php

示例12: _getCookie

 /**
  * Helper method to read the cookie information
  *
  * @param $name
  * @return null|string
  */
 private function _getCookie($name)
 {
     return $this->_context->getRequest()->getCookie($name, '');
 }
開發者ID:richdynamix,項目名稱:personalised-products,代碼行數:10,代碼來源:SendGuestActionsCustomLogin.php


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