The redirect method of TP frame is how to realize jump? A look at the source code, completely can not understand AH.
protected function Redirect ($url, $params =array (), $delay =0, $msg = ") {
$url = U ($url, $params);
Redirect ($url, $delay, $msg);
}
First live a URL, and then recursively pass in the third fourth parameter:
How does its jump come true???
------Solution--------------------
The redirect in the function body is called a function:
See the framework's built-in functions.php file
redirect
Description
void Redirect ($url, $time =0, $msg = ")
URL redirection
Source:
function Redirect ($url, $time =0, $msg = ") {
Multi-line URL address support
$url = Str_replace (Array ("\ n", "\ R"), ", $url);
if (empty ($msg))
$msg = "The system will automatically jump to {$url}! after {$time} seconds ";
if (!headers_sent ()) {
redirect
if (0 = = = $time) {
Header (' Location: '. $url);
} else {
Header ("refresh:{$time};url={$url}");
Echo ($msg);
}
Exit ();
} else {
$str = "
";
if ($time! = 0)
$str. = $msg;
Exit ($STR);
}
}