本文整理汇总了PHP中KRequest::_referrer方法的典型用法代码示例。如果您正苦于以下问题:PHP KRequest::_referrer方法的具体用法?PHP KRequest::_referrer怎么用?PHP KRequest::_referrer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KRequest
的用法示例。
在下文中一共展示了KRequest::_referrer方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: referrer
/**
* Returns the HTTP referrer.
*
* 'referer' a commonly used misspelling word for 'referrer'
* @see http://en.wikipedia.org/wiki/HTTP_referrer
*
* @param boolean Only allow internal url's
* @return KHttpUrl A KHttpUrl object
*/
public static function referrer($isInternal = true)
{
if (!isset(self::$_referrer)) {
if ($referrer = KRequest::get('server.HTTP_REFERER', 'url')) {
self::$_referrer = KService::get('koowa:http.url', array('url' => $referrer));
}
}
if ($isInternal) {
if (!KService::get('koowa:filter.internalurl')->validate((string) self::$_referrer)) {
return null;
}
}
return self::$_referrer;
}
示例2: referrer
/**
* Returns the HTTP referrer.
*
* 'referer' a commonly used misspelling word for 'referrer'
* @see http://en.wikipedia.org/wiki/HTTP_referrer
*
* @param boolean Only allow internal url's
* @return KHttpUri A KHttpUri object
*/
public static function referrer($isInternal = true)
{
if (!isset(self::$_referrer)) {
if ($referrer = KRequest::get('server.HTTP_REFERER', 'url')) {
self::$_referrer = KFactory::get('lib.koowa.http.uri', array('uri' => $referrer));
if ($isInternal) {
if (!KFactory::get('lib.koowa.filter.internalurl')->validate((string) self::$_referrer)) {
return null;
}
}
}
}
return self::$_referrer;
}