PHP使用代码点火器-未找到对象
视图:vw_home.phpPHP使用代码点火器-未找到对象,php,codeigniter,Php,Codeigniter,视图:vw_home.php 控制器:home.php _我猜这个模型在这里不适用;我是Codeigniter的新手,结果发现它有一个错误 找不到对象 有人能帮我吗:(这里还缺少什么?你需要把文件的第一个字母和类名大写为home.php应该是home.php 及 应该 class Home extends CI_Controller{ 将$route['default\u controller']更改为 $route['default\u controller']='home\in
控制器:home.php
_我猜这个模型在这里不适用;我是Codeigniter的新手,结果发现它有一个错误
找不到对象
有人能帮我吗:(这里还缺少什么?你需要把文件的第一个字母和类名大写为
home.php
应该是home.php
及
应该
class Home extends CI_Controller{
将
$route['default\u controller']
更改为
$route['default\u controller']='home\index'
到
$route['default\u controller']='home'
因为它正在
主页
文件夹中查找控制器索引
。错误指向的代码行是什么?请发布完整的错误日志详细信息。类和文件名的首字母必须仅为大写。在Ci3版本中。如本文所述,如果这能满足您的解决方案,请接受此答案问题
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class home extends CI_Controller{
function __construct(){
parent::__construct();
}
function index(){
$data['page_title']="WELCOME | CSB SDP";
$this->load->view('SideBar',$data);
}
}
}
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
$route['default_controller'] = 'home/index';
?>
class home extends CI_Controller{
class Home extends CI_Controller{