Home  >  Article  >  Backend Development  >  thinkphp可加载默许模块,无法加载额外模块是什么原因

thinkphp可加载默许模块,无法加载额外模块是什么原因

WBOY
WBOYOriginal
2016-06-13 12:23:11772browse

thinkphp可加载默认模块,无法加载额外模块是什么原因
按照视频做thinkphp的例子,
如果用以下 url是可以的,IndexAction.class.php 可以运行
http://localhost/thinkp/Admin.php/


但是输入  http://localhost/thinkp/Admin.php/User/index/

http://localhost/thinkp/Admin.php/User/index/
都出现以下问题


错误位置: FILE: E:\wamp\www\thinkp\ThinkPHP\Lib\Think\Core\App.class.php LINE: 297

[ 错误信息 ]
无法加载模块User

[ TRACE ]
[15-07-19 01:18:07] E:\wamp\www\thinkp\ThinkPHP\Lib\Think\Core\App.class.php (297) App::exec()
[15-07-19 01:18:07] E:\wamp\www\thinkp\admin.php (12) App::run()


admin.php文件在根目录
define('APP_NAME','Admin');
define('APP_PATH','Admin');
define('THINK_PATH','./ThinkPHP');
require THINK_PATH.'/ThinkPHP.php';
App::run();
?>


UserAction 文件和IndexAction.class.php 放在Action目录下
E:\wamp\www\thinkp\Admin\Lib\Action\UserAction.class.php

class UserAction extends Action{
 function index(){
echo '用户列表';
}
 function add(){
echo 'User/add';
}
}
?>




------解决思路----------------------
建议你认真阅读一下开发手册 http://document.thinkphp.cn/manual_3_2.html
------解决思路----------------------
APP_PATH定义错了,看一下手册吧。结合视频和手册学习效果才好,视频有很多都讲不到
------解决思路----------------------
但是输入  http://localhost/thinkp/Admin.php/User/index/

http://localhost/thinkp/Admin.php/User/index/
都出现以下问题

这两个不是一样的吗?

define('APP_NAME','Admin'); Admin应该是folder吧。

http://localhost/thinkp/Admin/User/index/  改这样试试。


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