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


PHP Mage_Core_Controller_Request_Http::has方法代码示例

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


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

示例1: setNeverExpireBrowserCacheHeader

 public function setNeverExpireBrowserCacheHeader(Mage_Core_Controller_Request_Http $httpRequest, Mage_Core_Controller_Response_Http $response)
 {
     if (!Mage::app()->useCache('config')) {
         return $this;
     }
     if (!$httpRequest->has(self::FUZE_VALUE_CACHE_KEY)) {
         Mage::log("MegaMenu cache problem: You cannot set never expire browser cache, because this http request has not been secured by the fuze url param.");
         return $this;
     }
     $expires = gmdate('D, d M Y H:i:s \\G\\M\\T', time() + 3600 * self::HOURS_IN_BROWSER_CACHE);
     $maxAge = self::HOURS_IN_BROWSER_CACHE * 3600;
     $response->setHeader('Pragma', 'public', true);
     $response->setHeader('Expires', $expires, true);
     $response->setHeader('Cache-Control', "public, max-age={$maxAge}", true);
     return $this;
 }
开发者ID:creatuitydevelopers,项目名称:mega-menu,代码行数:16,代码来源:Cache.php

示例2: applyCodeFromRequest

 /**
  * Takes in an HTTP request and applies the code
  *
  * @param Mage_Core_Controller_Request_Http $request
  * @return boolean
  */
 public function applyCodeFromRequest($request)
 {
     list($couponParam, $errorParam) = $this->getParams();
     $session = Mage::getSingleton('core/session');
     $errorCode = $request->getParam($errorParam, null);
     $couponCode = $request->getParam($couponParam, null);
     if ($errorCode || $couponCode) {
         if (!empty($couponCode)) {
             $force = $request->has(self::FORCE_PARAM);
             try {
                 $coupon = $this->_validateCode($couponCode, $force);
                 if (!$this->isCouponApplied($coupon->getRuleId(), $couponCode)) {
                     $this->applyCode($coupon->getRuleId(), $couponCode);
                     $session->addSuccess($this->getSuccessMessage($couponCode));
                 }
                 return true;
             } catch (Exception $e) {
                 $errorCode = $e->getMessage();
             }
         }
         if (!$this->isValidErrorCode($errorCode)) {
             $errorCode = self::INVALID_CODE;
         }
         $session->addError($this->getErrorMessage($errorCode, $couponCode));
     }
     return false;
 }
开发者ID:bevello,项目名称:bevello,代码行数:33,代码来源:Coupon.php


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