title: Calling Curl(ed) json content from Code Igniter
body: <p>This is my function in model </p>
  
  <pre><code>&lt;?php
      class Clothes_model extends CI_Model {
  
      public function __construct()
      {
          $this-&gt;load-&gt;database();
      }
  
      public function get_clothes()
      {
          $url="http://192.168.0.105/ci/json_source/clothes.php";//clothes.php contain json data
          $data= this-&gt;curl-&gt;simple_get($url);
          $result = json_decode($data,true);
          return $result;
      }
  }
  </code></pre>
  
  <p>This is my controller </p>
  
  <pre><code>&lt;?php
  class Clothes extends CI_Controller {
  
      public function __construct()
      {
          parent::__construct();
          $this-&gt;load-&gt;model('clothes_model');
      }
  
      public function view($result)
      {
          $data['clothes_item'] = $this-&gt;clothes_model-&gt;get_clothes();
  
          if (empty($data['clothes_item']))
          {
              show_404();
          }
  
          $data['title'] = $data['clothes_item']['title'];
  
          $this-&gt;load-&gt;view('templates/header', $data);
          $this-&gt;load-&gt;view('clothes/view', $data);
          $this-&gt;load-&gt;view('templates/footer');
      }
  }
  </code></pre>
  
  <p>When I tried to run I got this error</p>
  
  <blockquote>
    <p>Parse error: syntax error, unexpected T_OBJECT_OPERATOR in
    /var/www/ci/application/models/clothes_model.php on line 12</p>
  </blockquote>
  
  <p>Is there anything wrong?</p>