PHP warning

Invalid argument supplied for foreach()

/home/gktizein.gr/public_html/protected/views/siteCategoryContent/viewContentProjectSingle.php(81)

69             $('#project_map').hide();
70             $('#project_price').hide();
71             $('#project_video').hide();
72             $('#project_broch').hide();
73         }
74 
75 
76         $(window).load(function () {
77 
78 
79             <?php
80             $myarray = array();
81             foreach ($project->contentProjectResources as $resource) {
82                 array_push($myarray, $resource->id);
83             }
84             echo 'var resourcesArray = new Array(' . implode(',', $myarray) . ');';
85             ?>
86 
87             //
88 
89             var curImage = 0;
90             var curImageID = resourcesArray[0];
91             $('ul.images .img' + curImageID).animate({opacity: 1});
92             window.myInterval = setInterval(function () {
93                 var curname = 'img' + resourcesArray[curImage];

Stack Trace

#4
+
 /home/gktizein.gr/public_html/protected/controllers/SiteCategoryContentController.php(426): CController->render("viewContentProjectSingle", array("model" => SiteCategoryContent, "lang" => "", "id" => "26"))
421         $model = SiteCategoryContent::model()->find('siteCategoryID=:siteCategoryID', array(':siteCategoryID' => $pageid));
422         if (isset($pageid)) {
423             $this->menu = $this->createMenu($pageid, $lang);
424             $this->bgimage = 'bgimage' .$pageid.'.jpg';
425             $this->breadcrumb = $this->createBreadCrumb($pageid, $lang);
426             $this->render('viewContentProjectSingle', array('model' => $model, 'lang' => $lang, 'id' => $id));
427         }else
428             throw new CHttpException(400, 'Invalid request. Please do not repeat this request again.');
429     }
430 
431     public function actionViewContentPropertySingle($pageid, $id, $lang = 1) {
#19
+
 /home/gktizein.gr/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 13:29:35 Apache Yii Framework/1.1.10