这些是控制器
class Dashboard extends CI_Controller{
public function __construct(){
parent::__construct();
$this->load->model("admin/post_model");
$this->load->model("admin/comment_model");
}
public function index(){
$data['post_res'] = $this->post_model->getPost();
$data['com_res'] = $this->post_model->getComments();
}
}
我无法在同一个控制器中加载 2 个模型。它给了我一个错误
Fatal error: Call to a member function getComments() on a non-object in C:\xampp\htdocs\blog\application\controllers\ram-admin\dashboard.php on line 13
我怎么可能加载模型?
提前非常感谢您!