CodeIgniter和Doctrine教程中的控制器错误 [英] Controller error in CodeIgniter and Doctrine tutorial

查看:145
本文介绍了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

错误:


致命错误:C:\wamp\www\\\
auka\\ \hello.php on line 5

Fatal error: Class 'Controller' not found in C:\wamp\www\nauka\application\controllers\hello.php on line 5

屏幕截图:

推荐答案

您的控制器应该扩展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教程中的控制器错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆