本文介绍了CodeIgniter和Doctrine教程中的控制器错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想连接到函数world(),但我得到一个错误。你知道我要做什么吗?有我的第一步与CodeIgniter - 我做。
I would like to connect to function world() but I get an error. Do you know what I have to do? There are my first steps with CodeIgniter - I'm doing this tutorial.
网址我尝试过:
- localhost / nauka / index.php / hello / world
- localhost / nauka / index.php / Hello / world
错误:
屏幕截图:
推荐答案
您的控制器应该扩展CI_Controller
Your controller should extend CI_Controller
class Hello extends CI_Controller {
public function __construct()
{
parent::__construct();
}
对于旧版本可能有所不同,但您不应使用不要扩展CI_Controller。
This may be different for older versions but you shouldn't be using versions that don't extend CI_Controller anyhow.
此外,您需要父:: __结构
Also, you need the parent::__construct in there
这篇关于CodeIgniter和Doctrine教程中的控制器错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!