PHP warning

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

/home/havailam/public_html/protected/views/site/print.php(26)

14 
15 }
16 </script>
17         
18  <div class="row">
19          
20 <div class="col-xs-12 col-lg-12 col-md-12 col-sm-12" >
21             
22 
23        <div class="" >
24 
25             <div class="panel-body">
26        <?php if(count($post) > 0) { ?>
27 <!--شروع خبر-->        
28              <div class="row">
29              <br/><br/>
30                 <div class="col-xs-6 col-sm-6" >
31                     <h4><a href="#"><?php echo $post->title; ?></a></h4>
32                     <?php echo $post->lead; ?>
33                     <br/>
34                 </div>
35                 <div class="col-xs-6 col-sm-6">
36                      <img class=" img-rounded img-fullwidth img-min-height-width-100" style="height:200px;" src="<?php echo Yii::app()->request->baseUrl.'/'.UserImageAdministration::IMAGE_DIRECTORY_ADDRESS . $post->pic_adr; ?>" alt="260x260"> 
37                 </div>
38        <!--/col-*-4-->

Stack Trace

#4
+
 /home/havailam/public_html/protected/controllers/SiteController.php(198): CController->render("print", array("post" => Post))
193 
194         if (isset($_GET['postId'])) {
195             $model = Post::model()->findByPk($_GET['postId']);
196             if ($model != null) {
197                 $this->setPageTitle($model->title);
198                 $this->render('print', array('post' => $model));
199             } else {
200                 $this->render('print', array('post' => array()));
201             }
202         }
203     }
#12
+
 /home/havailam/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-28 12:47:44 LiteSpeed Yii Framework/1.1.15