PHP warning

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

/home/andrezgamez/public_html/protected/views/site/index.php(23)

11         <div id="logo">
12             <h1><a href="<?= Yii::app()->createUrl('site/index') ?>"><img id="logo_imagen" src="<?= $path_imagenes.'/logo.png' ?>" alt="Dimetronik" title="Dimetronik"></img></a></h1>
13         </div>
14         <div id="vision">
15             <?= Yii::t('app','Nuestra mayor pasión es crear soluciones nuevas y creativas para su empresa') ?>.
16         </div>
17     </div>
18     <div id="centro">
19         <h2><?= Yii::t('app', 'Proyectos recientes'); ?></h2>
20         <div id="ultimos_post">
21             <?php
22                 $items = $posts->channel->item;
23         $num_items = count($items);
24                 for($i = 0; $i < 5 && $i < $num_items; $i++) {  
25                     $entry = $items[$i]?>
26                     <div class="post_blog">
27                         <p class="fecha"><?= date('d/m/Y', strtotime($entry->pubDate)); ?></p>
28                         <h3 class="titulo"><a target="_blank" href="<?= $entry->link ?>"><?= $entry->title ?></a></h3>
29                         <?php 
30                         // define the namespaces that we are interested in
31                         /*$ns = array
32                         (
33                                 'content'  => 'http://purl.org/rss/1.0/modules/content/' ,
34                                 'wfw'  => 'http://wellformedweb.org/CommentAPI/' ,
35                                 'dc'  => 'http://purl.org/dc/elements/1.1/' 

Stack Trace

#4
+
 /home/andrezgamez/public_html/protected/controllers/SiteController.php(35): CController->render("index", array("posts" => null, "enviado" => false))
30 
31     public function actionIndex()
32     {
33                 //$posts =  Utilities::getFeed(Yii::app()->getBaseUrl(true).'/blog/?feed=rss2');
34         $post = array();
35         $this->render('index', array('posts'=>$posts, 'enviado'=>$this->mensaje_enviado));
36     }
37         
38     public function actionServicios()
39     {
40         $texto = isset($_GET['code'])? $_GET['code'] : NULL;
#12
+
 /home/andrezgamez/public_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();
2024-03-29 15:26:56 Apache Yii Framework/1.1.9