控制器里的操作方法不存在

浏览:3376 发布日期:2017/09/01 分类:ThinkPHP5专区
http://study.tp5.com/index/index/index
这样可以访问,
但是同一控制器下的hello操作方法提示不存在
访问链接:http://study.tp5.com/index/index/hello

index控制器代码如下<?php
namespace app\index\controller;

//use app\index\controller\Base;
use think\controller;
use think\Db;

class Index extends Controller
{
    public function index($name = 'world')
    {
        return 'hello,' . $name . '!';
//        $data = Db::name('data')->find();
//        $this->assign('result', $data);
//        return $this->fetch();
    }

    public function hello($name = 'World')
    {
        return 'Hello,' . $name . '!';
    }

//    public function sayhello($name = 'world')
//    {
//        return 'hello,' . $name . '!';
//    }
}
这该如何是好呢

还有浏览器错误提示,我的为什么会一闪而过呢,该如何配置

最佳答案
评论( 相关
后面还有条评论,点击查看>>