Home >php教程 >php手册 >ThinkPHP中自定义目录结构的设置方法

ThinkPHP中自定义目录结构的设置方法

WBOY
WBOYOriginal
2016-06-06 20:19:341026browse

现在很多朋友喜欢使用ThinkPHP但它会生成的很多目录有些朋友不喜欢,这里为大家分享下将目录都放到include目录的方法,这样就干净多了

效果如图所示:

入口文件

5.3.0 !'); // 网站文件入口位置 define('ABSPATH', dirname(__FILE__) . '/'); // 定义应用目录 define('APP_NAME', 'WEBSITE'); define('APP_PATH','./include/'); define('CONF_PATH', ABSPATH . '/config/'); define('RUNTIME_PATH', ABSPATH . '/cache/'); define('TMPL_PATH', ABSPATH . '/templates/'); define('UPLOAD_PATH', ABSPATH . '/uploads/'); define('THINK_PATH', APP_PATH . '/ThinkPHP/'); // 开启调试模式 define('APP_DEBUG',True); // 引入ThinkPHP入口文件 require THINK_PATH . 'ThinkPHP.php';

配置文件

'APP', 'URL_MODEL' => '2', 'TMPL_PARSE_STRING'=> array( '__PUBLIC__' => __ROOT__.'/static', '__UPLOAD__' => __ROOT__.'/uploads' ), 'TMPL_FILE_DEPR' => '_', );

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