PHP warning

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

/home/helenzak/public_html/themes/default/views/albums/album/image.php(16)

04     <a href="/index.php/albums/album/<?=$category_name->id?>"><?=$category_name->name?></a> &raquo; 
05     <b><?=$image->name?></b>
06 </div>
07 
08 <div class="controls singleimagecontrols">
09 <?foreach($others as $other){
10     
11         $urls[] = $other->id;
12         $sort[] = $other->sort;
13 
14 }
15 
16      if(count($urls)>1){
17         $current =  array_search($image->id, $urls); // return index in array
18 
19         
20             
21         if(end($urls) != $image->id){
22             $next =  $urls[$current + 1];
23             echo '
24 <a href="/index.php/albums/photo/'.$next.'">'.Yii::t("basket","Назад").' | </a>
25 
26             ';
27             }else{
28 

Stack Trace

#4
+
 /home/helenzak/public_html/protected/modules/albums/controllers/AlbumController.php(109): CController->render("image", array("image" => null, "category_name" => null, "others" => array()))
104         $criteria->condition='category_id=:category_id';
105         $criteria->params=array(':category_id'=>$image['category_id']);
106         $criteria->order = ("sort desc");
107         $others=Image::model()->findAll($criteria); // $params не требуется
108 
109         $this->render('image', array('image'=>$image, 'category_name'=>$category_name, 'others'=>$others));
110 
111     }
112 
113 
114 
#14
+
 /home/helenzak/public_html/index.php(15): CApplication->run()
10 // при работе сайта в "боевом" режиме следующие две строки рекомендуется закомментировать
11 defined('YII_DEBUG') or define('YII_DEBUG', true);
12 defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL', 3);
13 
14 require_once($yii);
15 Yii::createWebApplication($config)->run();
2024-03-29 07:08:09 Apache Yii Framework/1.1.12