PHP warning

count(): Parameter must be an array or an object that implements Countable

/home/ivanwilmington/public_html/protected/controllers/AirController.php(62)

50         );
51     }
52         
53         public function actionIndex(){
54             $this->render('index');
55         }
56 
57         
58         public function actionView($id){
59             $url = 'https://ivan-imperial.org/air/datajson';  
60             $data = json_decode(file_get_contents($url));
61 
62             for($i=0; $i<count($data);$i++){
63                 if($data[$i]->dylos == $id){
64                     $model = $data[$i];
65                 }
66             }
67             $this->render('view', array(
68                 'model'=>$model,
69             ));
70         }
71         
72         public function actionMap(){
73             $url = 'https://ivan-imperial.org/air/datajson';
74             $model = json_decode(file_get_contents($url));

Stack Trace

#14
+
 /home/ivanwilmington/public_html/index.php(13): CApplication->run()
08 defined('YII_DEBUG') or define('YII_DEBUG',true);
09 // specify how many levels of call stack should be shown in each log message
10 defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);
11 
12 require_once($yii);
13 Yii::createWebApplication($config)->run();
2024-03-19 09:22:25 Apache Yii Framework/1.1.20