Home  >  Article  >  Backend Development  >  PHP development(33)-ThinkPHP5.0(5) namespace and TP5-PhpStorm

PHP development(33)-ThinkPHP5.0(5) namespace and TP5-PhpStorm

黄舟
黄舟Original
2017-03-03 10:07:562085browse

Based on the first two namespace blog posts, let’s take a look at the relationship between namespaces, public spaces and ThinkPHP5..0:

1 , controller controller

First we find the index controller (controller),

\application\index\controller\Index.php,

Repair it, the modified Index.php:

fetch();
        }
    }

2, view view

Then we manually create the following two folders view and index, and create index.html for controlling the index view,

##\application\index\view\index\ index.html,

Created index.html:




    
    Titleiwanghang

Do you still remember our entry file?

\public\index.php, without any modification, let’s run it and the printed result is iwanghang


// +----------------------------------------------------------------------

// [ 应用入口文件 ]

// 定义应用目录
define('APP_PATH', __DIR__ . '/../application/');
// 加载框架引导文件
require __DIR__ . '/../thinkphp/start.php';

The above is PHP development (33)- ThinkPHP5.0(5) namespace and TP5-PhpStorm content, please pay attention to the PHP Chinese website (m.sbmmt.com) for more related content!



Statement:
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