How does The redirect Method of the TP framework achieve redirection? I can't understand the source code at all .. Protected & nbsp; function & nbsp; redirect ($ url, $ paramsarray (), $ delay0, $ msg) & nbsp; {$ url & nbsp; U ($ url, $ params); how does The redirect Method of the redirect ($ url, $ delay, $ m TP framework achieve redirection? I can't understand the source code at all ..
Protected function redirect ($ url, $ params = array (), $ delay = 0, $ msg = ''){
$ Url = U ($ url, $ params );
Redirect ($ url, $ delay, $ msg );
}
Store a url, and recursively input the third and fourth parameters ..
How does one achieve the jump to the bottom ???
------ Solution --------------------
Redirect in the function body calls a function:
See the built-in functions. php file of the framework.
Redirect
Note:
Void redirect ($ url, $ time = 0, $ msg = '')
URL redirection
Source code:
Function redirect ($ url, $ time = 0, $ msg = ''){
// Multi-line URL 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 );
}
}