ErrorException [ Warning ]: Invalid argument supplied for foreach()

APPPATH/classes/model/category.php [ 26 ]

21     $output = curl_exec($ch);
22     curl_close($ch); 
23     $data = json_decode($output);
24 
25         $model = new self;
26         foreach($data as $k => $v){
27             $model->setId($k);
28             $model->setName($v[0]); 
29             $model->setDesc($v[1]);            
30         }
31         return $model;
  1. APPPATH/classes/model/category.php [ 26 ] » Kohana_Core::error_handler(arguments)

  2. APPPATH/classes/controller/pages.php [ 25 ] » Model_Category->getById(arguments)

  3. {PHP internal call} » Controller_Pages->action_oferta()

  4. SYSPATH/classes/kohana/request/client/internal.php [ 118 ] » ReflectionMethod->invoke(arguments)

  5. SYSPATH/classes/kohana/request/client.php [ 64 ] » Kohana_Request_Client_Internal->execute_request(arguments)

  6. SYSPATH/classes/kohana/request.php [ 1138 ] » Kohana_Request_Client->execute(arguments)

  7. DOCROOT/index.php [ 109 ] » Kohana_Request->execute()

Environment