PHP warning

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

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

13922         $data = kaushalaajivikaemployerdata($page, $limit,$type,$district);
13923         $data = json_decode($data);
13924 
13925         // $filters = Yii::app()->request->getParam('filter', array());
13926         // $filteredData = applyFilters($data->data, $filters);
13927         // print_r($filteredData);exit;
13928         $dataProvider = new CArrayDataProvider($data->data, [
13929             'keyField' => 'company_name',
13930             'pagination' => [
13931                 'pageSize' => $limit,
13932                 'currentPage' => $page - 1, // CArrayDataProvider is 0-based
13933             ],
13934             'totalItemCount' => $data->total ?? count($data->data),
13935 
13936         ]);
13937         // echo "<pre>";
13938         // print_r($dataProvider->getData());exit;
13939 
13940 
13941 
13942         $this->render(
13943             'getKAEmployerList',
13944             [
13945                 'dataProvider' => $dataProvider,
13946                 '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-06-27 01:09:16 Apache/2.4.54 (Debian) Yii Framework/1.1.20