thinkphp Learning Notes 6-redirect page redirection

Source: Internet
Author: User

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

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.