Home Backend Development PHP Tutorial thinkphp3.0输出重复两次的解决方法_php实例

thinkphp3.0输出重复两次的解决方法_php实例

Jun 07, 2016 pm 05:14 PM
Solution output

本文实例讲述了thinkphp3.0输出重复两次的解决方法。分享给大家供大家参考。具体方法如下:

主入口文件如下:

复制代码 代码如下:
define('APP_NAME','Admin');//定义项目名称 
define('APP_PATH','./Admin/');//定义项目存放路径 
define('THINK_PATH','./ThinkPHP/');//定义ThinkPHP核心文件所在路径 
require THINK_PATH.'ThinkPHP.php';//导入核心文件 
App::run(); 
?>

使用以上代码作文入口文件,但输入结果重复两次.

原来是因为 thinkphp3.0的入口文件更加简化,默认情况下,只需要添加一行代码即可,将App::run();这行代码注释掉或者去掉就正常了.

复制代码 代码如下:
define('APP_NAME','Admin');//定义项目名称 
define('APP_PATH','./Admin/');//定义项目存放路径 
define('THINK_PATH','./ThinkPHP/');//定义ThinkPHP核心文件所在路径 
require THINK_PATH.'ThinkPHP.php';//导入核心文件 
//App::run(); 
?>

希望本文所述对大家基于ThinkPHP框架的PHP程序设计有所帮助。

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot Article Tags

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Printer operation cannot be completed error 0x0000709 Solution Printer operation cannot be completed error 0x0000709 Solution Apr 20, 2024 pm 10:10 PM

Printer operation cannot be completed error 0x0000709 Solution

Methods to solve the problem of Chinese garbled characters in PHP Dompdf Methods to solve the problem of Chinese garbled characters in PHP Dompdf Mar 05, 2024 pm 03:45 PM

Methods to solve the problem of Chinese garbled characters in PHP Dompdf

What should I do if my Black Shark phone continues to cycle on and off? The solution is revealed! What should I do if my Black Shark phone continues to cycle on and off? The solution is revealed! Mar 25, 2024 am 09:36 AM

What should I do if my Black Shark phone continues to cycle on and off? The solution is revealed!

Linux Oops Revealed: Causes of Errors and Solutions Linux Oops Revealed: Causes of Errors and Solutions Mar 20, 2024 am 11:15 AM

Linux Oops Revealed: Causes of Errors and Solutions

Deepseek official website entrance access guide Solve the common problems that cannot be logged in Deepseek official website entrance access guide Solve the common problems that cannot be logged in Feb 19, 2025 pm 04:30 PM

Deepseek official website entrance access guide Solve the common problems that cannot be logged in

How to solve the problem of Pokemon Crystal, Diamond, Bright Pearl and Duck blocking the road? How to solve the problem of Pokemon Crystal, Diamond, Bright Pearl and Duck blocking the road? Apr 01, 2024 pm 02:33 PM

How to solve the problem of Pokemon Crystal, Diamond, Bright Pearl and Duck blocking the road?

Solution to PHP mb_substr function not executing Solution to PHP mb_substr function not executing Mar 22, 2024 am 11:54 AM

Solution to PHP mb_substr function not executing

Solution to the problem of missing lib files in Linux system Solution to the problem of missing lib files in Linux system Mar 20, 2024 am 10:30 AM

Solution to the problem of missing lib files in Linux system

See all articles