Thinkphp3.0 solution for repeated output twice _ php instance

Source: Internet
Author: User
This article describes how to repeat thinkphp3.0 output twice. The solution is to convert ThinkPHP2.x to 3. x frequently encounters problems. For more information about thinkphp3.0 output, see the example in this article. Share it with you for your reference. The specific method is as follows:

The main portal file is as follows:

The Code is as follows:

<? Php
Define ('app _ name', 'admin'); // define the project NAME
Define ('app _ path', './Admin/'); // defines the Project Storage PATH
Define ('Think _ path', './ThinkPHP/'); // defines the PATH of the ThinkPHP Core File
Require THINK_PATH. 'thinkphp. php'; // import the Core File
App: run ();
?>


Use the preceding Code Composition entry file, but repeat the input results twice.

It turns out that the thinkphp3.0 portal file is simpler. By default, you only need to add a line of code to comment out or remove the App: run (); this line of code is normal.

The Code is as follows:

<? Php
Define ('app _ name', 'admin'); // define the project NAME
Define ('app _ path', './Admin/'); // defines the Project Storage PATH
Define ('Think _ path', './ThinkPHP/'); // defines the PATH of the ThinkPHP Core File
Require THINK_PATH. 'thinkphp. php'; // import the Core File
// App: run ();
?>

I hope this article will help you design PHP programs based on the 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.