PHP warning

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

/home/ettijahat/public_html/protected/views/page/categoryItemList.php(12)

01 <?php
02 
03 /*
04  * To change this template, choose Tools | Templates
05  * and open the template in the editor.
06  */
07 ?>
08 <div class="row collapse">
09     <div class="large-3 columns">
10         <h1 style="text-align: center;"><?php echo $typeTitle;?></h1>
11         <?php
12         if(count($categoriesProvider)>0){
13             echo '<ul class="no-bullet">';
14             foreach ($categoriesProvider->data as $category)
15             {
16                 echo '<li><a href="'.yii::app()->createUrl('page/type',array('id'=>$category->type,'category'=>$category->id)).'">'.$category->title.'</a></li>';
17             }
18             echo '</ul>';
19         }
20         ?>
21     </div>
22     <div class="large-9 columns">
23         <?php
24         $this->widget('zii.widgets.CListView', array(

Stack Trace

#4
+
 /home/ettijahat/public_html/protected/controllers/PageController.php(114): CController->render("categoryItemList", array("categoriesProvider" => CActiveDataProvider, "itemsProvider" => CActiveDataProvider, "typeTitle" => "Projects"))
109             }
110             else
111                 $this->render('categoryItemList',array(
112                     'categoriesProvider'=>$categoriesProvider,
113                     'itemsProvider'=>$itemsProvider,
114                     'typeTitle'=>$typeModel->title
115                 ));
116         }
117         
118         public function categoriesProvider($type, $category = NULL){
119             if($category == NULL)
#14
+
 /home/ettijahat/public_html/index.php(20): CApplication->run()
15 defined('YII_DEBUG') or define('YII_DEBUG',true);
16 // specify how many levels of call stack should be shown in each log message
17  defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);
18 
19 require_once($yii);
20 Yii::createWebApplication($config)->run();
2024-03-29 10:29:56 Apache Yii Framework/1.1.14