我得到Unable加载请求的类:url
我的库代码是:-Curl_lib.php
<?php
class Curl_lib
{
function hello()
{
$CI = & get_instance();
$CI->load->library('url');
$msg = "Hello";
return $msg;
}
}
?>
控制器代码是:
<?php
class Curl extends CI_Controller
{
function __construct()
{
parent::__construct();
$this->load->library('curl_lib');
$this->load->helper('url');
}
function get_content()
{
$message = $this->curl_lib->hello();
echo $message;
}
}
?>
答案 0 :(得分:3)
试试吧
Url
不是图书馆。它是助手类。
<?php
class Curl_lib
{
function hello()
{
$CI = & get_instance();
$CI->load->helper('url');
$msg = "Hello";
return $msg;
}
}
?>