The examples in this article describe the redirect usage in thinkphp. Share to everyone for your reference. The specific analysis is as follows:
The general syntax for redirect redirection is: Redirect (Url,params=array (), delay=0,msg= "), assuming that currently the default home grouping aritcle module insert operation, some examples are as follows:
Copy Code code as follows:
Jump to edit action
$this->redirect (' edit ');
Jump to edit action under Useraction
$this->redirect (' User/edit ');
Jump to Admin group default module default action
$this->redirect (' admin/');
Jump to Admin Group Index Module View action
$this->redirect (' Admin-index/view ');
Jump to Admin Group Index Module View operation, uid parameter is 1, delay 3 seconds jump
$this->redirect (' Admin-index/view ', Array (' UID ' =>1), 3, ' page jump ')
Jump to other Otherapp items (not grouped) Admin Item group User Module View action
$this->redirect (' Otherapp://admin-user/view ');
As with URL access in project groupings, redirect jumps across groups is just one more concept of grouping item names.
Tip: You can use routing in redirect, and the parameter usage of the redirect method is consistent with the use of the U function. You can refer to the U function to generate a URL address related part.
More interested in thinkphp related content readers can view the site topics: "thinkphp Introductory Course", "thinkphp Template Operation Skills Summary", "thinkphp Common Methods Summary", "Smarty Template Introductory Course" and "PHP template technology Summary."
I hope this article will help you with the PHP program design based on thinkphp framework.