Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Rotua Panjaitan
yii2
Commits
89b57825
Commit
89b57825
authored
Sep 03, 2012
by
Qiang Xue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
web request/response WIP
parent
72ff81f7
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
0 deletions
+20
-0
Request.php
framework/web/Request.php
+0
-0
Response.php
framework/web/Response.php
+20
-0
No files found.
framework/web/Request.php
View file @
89b57825
This diff is collapsed.
Click to expand it.
framework/web/Response.php
View file @
89b57825
...
@@ -141,4 +141,24 @@ class Response extends \yii\base\Response
...
@@ -141,4 +141,24 @@ class Response extends \yii\base\Response
Yii
::
app
()
->
end
();
Yii
::
app
()
->
end
();
}
}
}
}
/**
* Redirects the browser to the specified URL.
* @param string $url URL to be redirected to. If the URL is a relative one, the base URL of
* the application will be inserted at the beginning.
* @param boolean $terminate whether to terminate the current application
* @param integer $statusCode the HTTP status code. Defaults to 302. See {@link http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html}
* for details about HTTP status code.
*/
public
function
redirect
(
$url
,
$terminate
=
true
,
$statusCode
=
302
)
{
if
(
strpos
(
$url
,
'/'
)
===
0
)
{
$url
=
$this
->
getHostInfo
()
.
$url
;
}
header
(
'Location: '
.
$url
,
true
,
$statusCode
);
if
(
$terminate
)
{
Yii
::
app
()
->
end
();
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment