The Thinkphp Redirect method enables page redirection (jump) functionality. The redirect method syntax is as follows:
$this->redirect (stringarraystring
Parameter description
url-The URL expression that must be redirected.
params-optional, other URL parameters.
delay-Optional, redirect delay, in seconds.
msg-Optional, redirect prompt information.
Thinkphp REDIRECT Instances
In the index module, in the index method, redirect to the select operation for this module:
class extends action{ publicfunction index () { $thisarray(' Status ' =>1), 3, ' page jump ~ ');} }
The URL that you get after redirection may be: HTTP://WWW.5IDEV.COM/INDEX.PHP/INDEX/SELECT/STATUS/1
Some common examples of redirect redirects are:
No delay, direct redirect $this->redirect (' select ', Array (' status ' =>1));//delay jump, but without parameters, output default prompt $this->redirect (' select ', ' ', 3);//redirect to other module operations $this->redirect (' Public/login ');//redirect to other grouping $this->redirect (' Admin-public/login ');
thinkphp Learning Notes 6-redirect page redirection