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


PHP SS_HTTPResponse::getVars方法代码示例

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


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

示例1: onBeforeHTTPError404

 /**
  * On every URL that generates a 404, we'll capture it here and see if we can
  * find an old URL that it should be redirecting to.
  *
  * @param SS_HTTPResponse $request The request object
  * @throws SS_HTTPResponse_Exception
  */
 public function onBeforeHTTPError404($request)
 {
     // We need to get the URL ourselves because $request->allParams() only has a max of 4 params
     $params = preg_split('|/+|', $request->getURL());
     $getvars = $request->getVars();
     unset($getvars['url']);
     $page = self::find_old_page($params);
     if ($page) {
         $res = new SS_HTTPResponse();
         $res->redirect(Controller::join_links($page, $getvars ? '?' . http_build_query($getvars) : null), 301);
         throw new SS_HTTPResponse_Exception($res);
     }
 }
开发者ID:maent45,项目名称:redefine_renos,代码行数:20,代码来源:OldPageRedirector.php

示例2: onBeforeHTTPError404

 /**
  * On every URL that generates a 404, we'll capture it here and see if we can
  * find an old URL that it should be redirecting to.
  *
  * @param SS_HTTPResponse $request The request object
  * @throws SS_HTTPResponse_Exception
  */
 public function onBeforeHTTPError404($request)
 {
     // Build up the request parameters
     $params = array_filter(array_values($request->allParams()), function ($v) {
         return $v !== NULL;
     });
     $getvars = $request->getVars();
     unset($getvars['url']);
     $page = self::find_old_page($params);
     if ($page) {
         $res = new SS_HTTPResponse();
         $res->redirect(Controller::join_links($page, $getvars ? '?' . http_build_query($getvars) : null), 301);
         throw new SS_HTTPResponse_Exception($res);
     }
 }
开发者ID:jakedaleweb,项目名称:AtomCodeChallenge,代码行数:22,代码来源:OldPageRedirector.php


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