This article mainly introduces the usage of redirect in thinkphp, the example analyzes the various common operation techniques of redirect redirection, has certain practical value, the need of friends can refer to the following
The examples in this paper 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 the current default home grouping aritcle module insert operation, some examples are as follows:
Copy the Code code as follows:
Jump to edit Operation $this->redirect (' edit '); Jump to the edit operation under Useraction $this->redirect (' User/edit '); Jump to Admin group default module default action $this->redirect (' admin/');//Jump to Admin Group Index Module View Operation $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 in ~ ') //Jump to other Otherapp items (non-grouped) Admin project group User Module View Operation $this->redirect (' Otherapp://admin-user/view ');
As with URL access in a project group, a cross-grouping jump in redirect is just the concept of a grouped item name.
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 the relevant part of the URL address.
Related recommendations:
Example of thinkphp R method