Request类增加url方法 Response类增加sendHttpStatus方法

This commit is contained in:
thinkphp
2016-05-07 22:06:17 +08:00
parent 044ef6098c
commit 02e8b2e8d0
2 changed files with 77 additions and 0 deletions

View File

@@ -66,6 +66,21 @@ class Request
'csv' => 'text/csv',
];
/**
* 获取当前URL
* @access public
* @param string $url URL地址
* @return string
*/
public static function url($url = '')
{
if (!empty($url)) {
self::$url = $url;
} else {
return self::$url ?: $_SERVER[Config::get('url_request_uri')];
}
}
/**
* 获取基础URL
* @access public