TypeError

count(): Argument #1 ($value) must be of type Countable|array, null given

/data/www/agama-as.cz/public_html/protected/components/views/productsListView.php(4)

01 
02 <?php
03 
04               $rows = ceil( count($products) / 2 );
05               $prodCount = count($products);
06 
07               if($products != null){
08                 echo '<div class="rowie mBottom30">';
09                 for ($j=0 ; $j < $rows*2; $j++) { 
10 
11                   if(($j % 2 == 0 && $j>0) || $j==0){
12                     echo '</div><div class="rowie mTop20">';
13                     $side = "pRight10";
14                   }
15                   else{
16                     $side = "pLeft10";

Stack Trace

#3
+
 /data/www/agama-as.cz/public_html/protected/components/productsListWidget.php(21): CWidget->render()
16     
17     }
18 
19     public function run()
20     {
21         $this->render('productsListView', array('products' => $this->products, 'limit' => $this->limit, 'offset' => $this->offset, 'count' => $this->count, 'type' => $this->type, "query" => $this->query, "brand" => $this->brand, "tag" => $this->tag));
22     }
23 }
24 
25 ?>
#5
+
 /data/www/agama-as.cz/public_html/protected/views/site/produkty.php(45): CBaseController->widget()
40                     $tag = "";
41 
42                   if(!isset($brand))
43                     $brand = "";
44 
45                 $this->widget('productsListWidget', array('products' => $products, 'limit' => $limit, 'offset' => $offset, 'count' => $count, 'type' => $type, "query" => $query, "brand" => $brand, "tag" => $tag));
46               ?>
47             </div>
48 
49           </div>
50 
#10
+
 /data/www/agama-as.cz/public_html/protected/controllers/SiteController.php(319): CController->render()
314 
315         if(isset($_POST['ajax'])){
316             return $this->widget('productsListWidget', array('products' => $products, 'limit' => $limit, 'offset' => $offset, 'count' => $count, 'type' => $type, "query" => $query, "brand" => $brand, "tag" => $tag));
317         }
318         
319         return $this->render('produkty', array('products' => $products, 'limit' => $limit, 'offset' => $offset, 'count' => $count, 'type' => $type, "query" => $query, "tag" => $tag, "brand" => $brand));
320     }
321 
322     public function actionPouziteStroje($query="")
323     {
324         if($query == ""){
2024-03-19 06:46:11 Apache Yii Framework/1.1.22