Php 无法加载请求的类时遇到错误:Sistema[无自动加载]CodeIgniter
所以,我在遵循一个教程并修改代码,有一点我无法修复,我不明白为什么CI没有加载这个类。 这就是功能:Php 无法加载请求的类时遇到错误:Sistema[无自动加载]CodeIgniter,php,codeigniter,content-management-system,Php,Codeigniter,Content Management System,所以,我在遵循一个教程并修改代码,有一点我无法修复,我不明白为什么CI没有加载这个类。 这就是功能: function set_theme($propriedade, $valor, $replace = TRUE){ $ci =& get_instance(); $ci->load->library('sistema'); if($replace){ $ci->sistema->theme[$propriedade] =
function set_theme($propriedade, $valor, $replace = TRUE){
$ci =& get_instance();
$ci->load->library('sistema');
if($replace){
$ci->sistema->theme[$propriedade] = $valor;
}else{
if (!isset($ci->sistema->theme[$propriedade])) {
$ci->sistema->theme[$propriedade] = "";
}
$ci->sistema->theme[$propriedade] .= $valor;
}
} // <-- end set_theme -->
有人想到了如何修复它?将您的库重命名为Sistema,并将其放入“应用程序/库”文件夹中
class Sistema
{
protected $ci;
public $theme = array();
public function __construct(){
$this->ci =& get_instance();
$this->ci->load->helper('functions');
}
}
您可以找到加载库的文档将库重命名为Sistema并将其放入“应用程序/库”文件夹中
class Sistema
{
protected $ci;
public $theme = array();
public function __construct(){
$this->ci =& get_instance();
$this->ci->load->helper('functions');
}
}
你可以找到加载库的文档谢谢,既然你说了(我之前看过文档),但我没有意识到我忘记了一件事:我正在学习的教程使用了CI 2x,我正在使用3x,但是谢谢,我已经将文件sistema.php重命名为sistema.php(以防万一)。谢谢,既然你说了(我之前看过文档)但我没有意识到我忘记了一件事:我正在学习的教程使用CI 2x,我正在使用3x,但是谢谢,我已经将文件sistema.php重命名为sistema.php(以防万一)。
class Sistema
{
protected $ci;
public $theme = array();
public function __construct(){
$this->ci =& get_instance();
$this->ci->load->helper('functions');
}
}