gpt4 book ai didi

codeigniter 无法加载库

转载 作者:行者123 更新时间:2023-12-03 15:05:15 24 4
gpt4 key购买 nike

我有一个问题,我无法在我的 Controller 中加载我的库:S

我收到此错误:消息:未定义的属性:Profil::$profileWall

我的图书馆:

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

class ProfileWall
{

private $CI;

public function __construct()
{
$this->CI =& get_instance();
}

public function wallShow()
{
$this->CI->load->model('profil_model');
return $this->CI->profil_model->wallGet($this->CI->uri->segment(3));
}
}

和我的 Controller
    function index()
{
$this->load->model('profil_model');
$data['query'] = $this->profil_model->vis_profil($this->uri->segment(3));


//Henter lib profilwall så man kan vise wall beskeder i profilen
$this->load->library('profileWall');
$data['queryWall'] = $this->profileWall->wallShow();



$data['content'] = 'profil_view';
$this->load->view('includes/template', $data);


}

我究竟做错了什么?

最佳答案

根据 Documentation 确保您的库加载始终以小写形式完成, 对象实例总是小写。

还要确保您的库文件大写 ProfileWall.php
示例负载 $this->load->library('profilewall');
用法 $this->profilewall->function();

关于codeigniter 无法加载库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4776399/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com