thinkphp无法访问模块是怎么回事

<?php
// 本类由系统自动生成,仅供测试用途
class IndexAction extends Action {
public function index(){
//echo "哈哈哈!!!";
$this->display();
}
public function show(){
//echo "欢迎你".$_GET['name']."!!!";
$this->display();
}
}
只能访问index方法对应的模块,不能访问show方法模块,求大神解答?

错误提示
FILE: F:\AppServ\www\fuxi\7\3\thinkphp\Common\functions.php  
LINE: 112

ThinkPHP3.1.3 { Fast & Simple OOP PHP Framework } -- [ WE CAN DO IT JUST THINK ]

帮你试过了 是可以访问的

首先你说  只能访问index方法对应的模块,那么你要确定一下手动访问index是如何访问,,通过上图我猜测http://localhost/App/index.php/Index/index 应该是这个(注意index.php前面的要修改成自己的),然后你把最后一个index修改成show就可以访问你的show方法了

温馨提示:答案为网友推荐,仅供参考
第1个回答  2018-06-08
确保你的入口文件绑定了Home模块才行。
入口文件添加 define('BIND_MODULE','Home');本回答被网友采纳
相似回答