diff options
author | Derek Allard <derek.allard@ellislab.com> | 2008-04-27 15:35:20 +0200 |
---|---|---|
committer | Derek Allard <derek.allard@ellislab.com> | 2008-04-27 15:35:20 +0200 |
commit | 05f830c7105ef3cd4a8388bffe7cf73c35236105 (patch) | |
tree | c8cf4ac58531db10ff7606ae8f2eea29a092b779 /system | |
parent | f9d5348cf2776374bf09bdda8c941198167d9ae9 (diff) |
Added the ability to include an optional HTTP Response Code in the redirect() function of the URL Helper.
Diffstat (limited to 'system')
-rw-r--r-- | system/helpers/url_helper.php | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/system/helpers/url_helper.php b/system/helpers/url_helper.php index bd94b390c..1ff26082c 100644 --- a/system/helpers/url_helper.php +++ b/system/helpers/url_helper.php @@ -470,6 +470,8 @@ if (! function_exists('url_title')) * Header Redirect
*
* Header redirect in two flavors
+ * For very fine grained control over headers, you could use the Output
+ * Library's set_header() function.
*
* @access public
* @param string the URL
@@ -478,13 +480,13 @@ if (! function_exists('url_title')) */
if (! function_exists('redirect'))
{
- function redirect($uri = '', $method = 'location')
+ function redirect($uri = '', $method = 'location', $http_response_code = 302)
{
switch($method)
{
case 'refresh' : header("Refresh:0;url=".site_url($uri));
break;
- default : header("Location: ".site_url($uri));
+ default : header("Location: ".site_url($uri), TRUE, $http_response_code);
break;
}
exit;
|