这是我在模型中的功能
<?php
class Clothes_model extends CI_Model {
public function __construct()
{
$this->load->database();
}
public function get_clothes()
{
$url="http://192.168.0.105/ci/json_source/clothes.php";//clothes.php contain json data
$data= this->curl->simple_get($url);
$result = json_decode($data,true);
return $result;
}
}
这是我的控制器
<?php
class Clothes extends CI_Controller {
public function __construct()
{
parent::__construct();
$this->load->model('clothes_model');
}
public function view($result)
{
$data['clothes_item'] = $this->clothes_model->get_clothes();
if (empty($data['clothes_item']))
{
show_404();
}
$data['title'] = $data['clothes_item']['title'];
$this->load->view('templates/header', $data);
$this->load->view('clothes/view', $data);
$this->load->view('templates/footer');
}
}
当我尝试运行时出现此错误
解析错误:语法错误,第 12 行 /var/www/ci/application/models/clothes_model.php 中的意外 T_OBJECT_OPERATOR
有什么不对的吗?