_php Example of redirect usage analysis in thinkphp

Source: Internet
Author: User
Tags php template smarty template

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.