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

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

WBOY
Release: 2016-06-23 13:30:29
Original
992 people have browsed it

按照视频做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/  改这样试试。


source:php.cn
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template