为了账号安全,请及时绑定邮箱和手机立即绑定

thinkphp操作方法和系统保留方法冲突,在框架类库中后缀增加方法,访问出错?

thinkphp操作方法和系统保留方法冲突,在框架类库中后缀增加方法,访问出错?

PHP
qq_大寒_2 2016-07-27 20:37:59
版本:thinkphp 3.2.3 开发文档中提到 注意:定义控制器方法的时候,尽量避免和系统的保留方法相冲突( 除非你非常明确自己在做什么 ), 这些保留方法名包括但不限于以下 display get show fetch theme assign error success 'ACTION_SUFFIX' => 'Action', // 操作方法后缀设置操作方法的后缀为Action,这样,控制器的操作方法定义调整为: <?php namespace Home\Controller; use Think\Controller; class IndexController extends Controller { public function listAction(){ echo 'list'; }  public function helloAction(){ echo 'hello'; }  public function testAction(){ echo 'test'; } } 本地还是访问不了?有同学可以解释下吗 ,url形如:http://localhost/index.php/Home/Index/listAction.html
查看完整描述

1 回答

?
慕仙5610752

TA贡献20条经验 获得超2个赞


不加.html试试

查看完整回答
反对 回复 2016-09-17
  • 1 回答
  • 0 关注
  • 1506 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信