Thinkphp custom error page and prompt page instance _php instance

Source: Internet
Author: User
This article describes the methods for customizing error pages and prompting pages in thinkphp. Share to everyone for your reference. The implementation method is as follows:

In thinkphp there are two methods when the error page _404 (' Error message ', ' Jump address ') is indicated, halt (' hint message ');
Both functions can customize the error page in the configuration file and copy the code code as follows: ' tmpl_exception_file ' = './public/tpl/error.html '
This will jump to this page every time.

Here is my custom error page
Copy the Code code as follows: After (3) seconds automatically jump, or click here to jump stop

$this->success (' Error message ', ' jump address (preferably with u ()) ', time);

$this->error ();

Here are the tips page that I changed thinkphp
Copy the Code code as follows:

Hint Message-thinkphp


<?php Echo ($message);?>


In ( <?php Echo ($waitSecond);?> ) seconds after the automatic jump, or directly click ' "> here to jump


It is hoped that this article will be helpful to everyone's thinkphp framework design.

  • 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: 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.