本文整理汇总了PHP中SS_HTTPResponse::getURL方法的典型用法代码示例。如果您正苦于以下问题:PHP SS_HTTPResponse::getURL方法的具体用法?PHP SS_HTTPResponse::getURL怎么用?PHP SS_HTTPResponse::getURL使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SS_HTTPResponse
的用法示例。
在下文中一共展示了SS_HTTPResponse::getURL方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
}