致命错误:不能使用Template类型的对象作为数组

时间:2014-10-05 22:52:26

标签: php codeigniter

Codeigniter有点问题 - 我正在尝试为CMS系统构建一个模块,但是我遇到了以下问题:

  

致命错误:不能在第16行的(baseURL)中使用Template类型的对象作为数组

代码如下:

if (!defined('BASEPATH')) exit('No direct script access allowed');

class Forum extends CI_Controller {

    function Forum()
    {
        parent::__construct();

        $this->template['module']   = 'forum';
        $this->load->model('forum_model', 'forum');
        $this->load->model('topic_model', 'topic');
        $this->load->model('message_model', 'message');
        $this->load->library("bbcode");
        $this->forum->get_user_level();

        $this->plugin->add_action('header', array(&$this, '_write_header'));
    }
}

1 个答案:

答案 0 :(得分:0)

您有一个名为'模板的图书馆'这是自动加载的。

库是对象,您尝试将此作为数组使用,这就是错误消息告诉您的内容。

相关问题