本文整理匯總了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;
}