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


PHP Http::isPost方法代码示例

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


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

示例1: afterDispatch

 /**
  * Set Cookie for msg box when it displays first
  *
  * @param \Magento\Framework\App\FrontController $subject
  * @param \Magento\Framework\App\ResponseInterface $response
  *
  * @return \Magento\Framework\App\ResponseInterface
  * @SuppressWarnings(PHPMD.UnusedFormalParameter)
  */
 public function afterDispatch(\Magento\Framework\App\FrontController $subject, \Magento\Framework\App\ResponseInterface $response)
 {
     if ($this->request->isPost() && $this->messageManager->hasMessages()) {
         $this->cookie->set(self::COOKIE_NAME, 1, self::COOKIE_PERIOD, '/');
     }
     return $response;
 }
开发者ID:Atlis,项目名称:docker-magento2,代码行数:16,代码来源:MessageBox.php

示例2: process

 /**
  * Handle private content version cookie
  * Set cookie if it is not set.
  * Increment version on post requests.
  * In all other cases do nothing.
  *
  * @return void
  */
 public function process()
 {
     if ($this->request->isPost()) {
         $publicCookieMetadata = $this->cookieMetadataFactory->createPublicCookieMetadata()->setDuration(self::COOKIE_PERIOD)->setPath('/')->setHttpOnly(false);
         $this->cookieManager->setPublicCookie(self::COOKIE_NAME, $this->generateValue(), $publicCookieMetadata);
     }
 }
开发者ID:IlyaGluschenko,项目名称:protection,代码行数:15,代码来源:Version.php

示例3: afterDispatch

 /**
  * Set Cookie for msg box when it displays first
  *
  * @param FrontController $subject
  * @param \Magento\Framework\App\ResponseInterface|\Magento\Framework\Controller\ResultInterface $result
  *
  * @return \Magento\Framework\App\ResponseInterface|\Magento\Framework\Controller\ResultInterface
  * @SuppressWarnings(PHPMD.UnusedFormalParameter)
  */
 public function afterDispatch(FrontController $subject, $result)
 {
     if ($this->request->isPost() && $this->messageManager->hasMessages()) {
         $publicCookieMetadata = $this->cookieMetadataFactory->createPublicCookieMetadata()->setDuration(self::COOKIE_PERIOD)->setPath('/')->setHttpOnly(false);
         $this->cookieManager->setPublicCookie(self::COOKIE_NAME, 1, $publicCookieMetadata);
     }
     return $result;
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:17,代码来源:MessageBox.php

示例4: process

 /**
  * Handle private content version cookie
  * Set cookie if it is not set.
  * Increment version on post requests.
  * In all other cases do nothing.
  *
  * @return void
  */
 public function process()
 {
     if ($this->request->isPost()) {
         $this->cookie->set(self::COOKIE_NAME, $this->generateValue(), self::COOKIE_PERIOD, '/');
     }
 }
开发者ID:Atlis,项目名称:docker-magento2,代码行数:14,代码来源:Version.php

示例5: consumeNotification

 /**
  * @inheritdoc
  */
 public function consumeNotification(\Magento\Framework\App\Request\Http $request)
 {
     if (!$request->isPost()) {
         throw new LocalizedException(new Phrase('POST request is required.'));
     }
     $response = $this->methodCaller->call('orderConsumeNotification', [$request->getContent()]);
     if ($response) {
         return ['payuplOrderId' => $response->order->orderId, 'status' => $response->order->status, 'amount' => (double) $response->order->totalAmount / 100];
     }
     return false;
 }
开发者ID:ORBA,项目名称:magento2_payupl,代码行数:14,代码来源:Order.php


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