PHP Error

Invalid argument supplied for foreach()

/var/www/vhosts/asociaperitos.com/httpdocs/protected/helpers/ACMS.php(59)

47 
48 class ACMS {
49     //put your code here
50 
51     //empty function for load this class and all constants defined in this file.
52     public static function load(){
53     }
54 
55     public static function getTitle($data, $lang=null){
56         //if(!isset($lang))
57         //    $lang=ACMS::getDefaultLang()->idLang;
58         $lang=YII::app()->getLanguage();
59         foreach ($data->content as $item)
60             if($item->lang===$lang)
61                 return $item->title;
62     }
63 
64     public static function getText($data, $lang=null){
65         //if(!isset($lang))
66         //    $lang=ACMS::getDefaultLang()->idLang;
67         $lang=YII::app()->getLanguage();
68         foreach ($data->content as $item)
69             if($item->lang===$lang)
70                 return $item->text;
71     }

Stack Trace

#0
+
 /var/www/vhosts/asociaperitos.com/httpdocs/themes/asociaperitos/views/site/event.php(20): ACMS::getTitle(null)
15 ?>
16 
17 <!--Proximos Eventos-->
18 <div class="proximos_eventos clearfix">
19     <br />
20     <h3 style="color:#CD0C0C; font-size:16px;"><?php echo ACMS::getTitle($model)?></h3><br>
21     <?php echo "<span class='fecha_evento'>$dia de $mes $ano</span>"; ?>
22         <p>Lugar: <?php echo CHtml::encode($model->location); ?></p>
23     <br />
24     <?php echo ACMS::getText($model)?>
25         <div class="clearfix" style="float:right;">
#5
+
 /var/www/vhosts/asociaperitos.com/httpdocs/protected/controllers/SiteController.php(320): CController->render("event", array(null))
315         }
316 
317     public function actionEvent(){
318         if(isset($_GET['id'])){        
319             $event=Evento::model()->findByPk($_GET['id']);
320             $this->render('event',array('model'=>$event));
321         }else{
322             throw new CHttpException(404,'The requested page does not exist.');    
323         }
324     }
325 
#13
+
 /var/www/vhosts/asociaperitos.com/httpdocs/index.php(10): CApplication->run()
05 
06 if(file_exists($config)){
07     // remove the following line when in production mode
08     defined('YII_DEBUG') or define('YII_DEBUG',true);
09     require_once($yii);
10     Yii::createWebApplication($config)->run();
11 }else{
12     header('Location: install/index.php');
13 }
2024-03-19 11:01:02 Apache Yii Framework/1.1.6