PHP warning

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

/var/www/html/protected/controllers/SiteController.php(13987)

13975 
13976         //TODO : Add Gender Or State filter Via API update.
13977         
13978         $data = kaushalaajivikaemployeddata($page, $limit);
13979         $data = json_decode($data);
13980         // print_r($data['data']);exit;
13981         $dataProvider = new CArrayDataProvider($data->data, [
13982 
13983             'pagination' => [
13984                 'pageSize' => $limit,
13985                 'currentPage' => $page - 1, // CArrayDataProvider is 0-based
13986             ],
13987             'totalItemCount' => $data->total ?? count($data->data),
13988 
13989         ]);
13990         // echo "<pre>";
13991         // print_r($dataProvider->getData());exit;
13992 
13993 
13994 
13995         $this->render(
13996             'getKAEmployedList',
13997             [
13998                 'dataProvider' => $dataProvider,
13999                 'pageSize' => $limit,

Stack Trace

#7
+
 /var/www/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();
2026-07-22 07:10:47 Apache/2.4.54 (Debian) Yii Framework/1.1.20