PHP warning

Invalid argument supplied for foreach()

/var/www/clients/client0/web7/web/protected/modules/frontEnd/views/site/pages/customer.php(20)

08                       <?php
09                         if(isset($contentDetail))
10                         {
11                             echo '<h2>'.$contentDetail->title.'</h2>';
12                             echo $contentDetail->content;
13                             ?>
14                             <br>
15                             <p style="float:right;"><a href="/customers"><?php echo Yii::t('main', 'Back');?></a></p>
16                             <?php
17                         }
18                         else
19                         {
20                             foreach ($model as $customer)
21                             {
22                                 ?>
23                                 <div class="media partner-media">
24 <!--                                    <div class="media-left"><img class="media-object" src="--><?php //echo $this->getModule()->getUploadsUrl().'/images/content/'.$customer->image;?><!--" alt="" width="203" height="118" /></div>-->
25                                     <div class="media-left"><img class="media-object" src="<?php echo Utility::imageBase64($this->getModule()->getUploadsUrl().'/images/content/'.$customer->image);?>" alt="<?php echo $customer->image; ?>" width="203" height="118" /></div>
26                                     <div class="media-body">
27                                         <h5 class="media-heading"><a href="<?php echo $this->createUrl('/'.  trim($customer->url,'/'));?>"><?php echo $customer->title;?></a></h5> 
28                                         
29                                         <?php echo $customer->intro;?>
30                                     </div>
31                                 </div>
32                                 <?php

Stack Trace

#4
+
 /var/www/clients/client0/web7/web/protected/modules/frontEnd/controllers/SiteController.php(547): CController->render("pages/customer", array("model" => null, "contentDetail" => null))
542         {
543             $contentDetail = $model = Content::model()->localized(Yii::app()->params['langId'])->findByAttributes(array('status'=>5, 'category' => $customersCateroryID, 'id' => $id));
544         }
545         $this->meta_description = @$model->meta_description;
546         $this->meta_keywords    = @$model->meta_keywords;
547         $this->render('pages/customer',array('model' => $model, 'contentDetail' => $contentDetail));
548     }
549 
550     public function actionContact()
551     {
552         $this->breadcrumbs = array(Yii::t('main', 'Contact Us'));
#14
+
 /var/www/clients/client0/web7/web/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();
16 
17 
2024-03-28 13:26:24 Apache Yii Framework/1.1.10