thinkphp5.1,类继承问题请问我的为什么是错的。class Index extends \think\Controller?
这个是Index.php控制器。<?phpnamespaceapp\index\controller;classIndexextends\think\Controller...
这个是Index.php控制器。<?phpnamespace app\index\controller;class Index extends \think\Controller{ public function index() { return "ok"; } public function hello($name = 'ThinkPHP5') { return 'hello,' . $name; } public function student(){ $student=\think\Db::name(‘student’)->filed(‘name’)->select(); $this->assgin(‘data’,$student); return $this->fetch();<?phpnamespace app\index\controller;<?phpnamespace app\index\controller;class Index extends \think\Controller{ public function index(){ return "ok"; }public function hello($name = 'ThinkPHP5') { return 'hello,' . $name; } public function student(){ $student=\think\Db::name(‘student’)->filed(‘name’)->select(); $this->assgin(‘data’,$student); return $this->fetch();}}
展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询