PHP notice

Trying to get property of non-object

/var/www/krgconorg/data/www/karfil.kz/protected/models/post/Post.php(481)

469          * @param string $close_tag
470          * @param array $htmlOptions
471          * @return string
472          */
473         
474         public function getGalery($thumb = true,$fancybox = false ,$open_tag = null,$close_tag = null,$htmlOptions = array()){
475             $result = null;
476             if(isset($this->galery)){
477                 foreach ($this->galery as $img) {
478                    if($thumb == false) $path = '/'.Yii::app()->controller->uploadImageDir.'/';
479                    else $path = '/'.Yii::app()->controller->uploadImageDirThumb.Yii::app()->controller->thumbPrefix;
480                    if($fancybox == false) $result .= $open_tag.CHtml::image($path.$img->images->path,Yii::app()->prostoLanguage->getLangValue($this->title),$htmlOptions).$close_tag;
481                    else $result .= $open_tag."<a href='".'/'. Yii::app()->controller->uploadImageDir . '/' .$img->images->path."' rel='group' class='fancybox'>".CHtml::image($path.$img->images->path,Yii::app()->prostoLanguage->getLangValue($this->title),$htmlOptions)."</a>".$close_tag;
482                 }
483             }
484             return $result;
485         }
486         
487         public function getDate($format = 'd.m'){
488             return date($format, strtotime($this->date));
489         }
490         
491         /**
492          * Возвращает ссылку для добавляение поста/товара
493          * в корзину. Если товар есть в наличии устанавливается 

Stack Trace

#0
+
 /var/www/krgconorg/data/www/karfil.kz/themes/philharmonic/views/post/view/gallery_view.php(5): Post->getGalery(true, true, "<div class="column span-4 tablet-6 mob-12"><div class="event-car...", "</div></div></div>")
1 <section class="content">
2     <div class="container">
3         <div class="events-grid">
4             <div class="row">
5                 <?php echo $model->getGalery(true , true , '<div class="column span-4 tablet-6 mob-12"><div class="event-card"><div class="img-box">' , '</div></div></div>');?>
6             </div>
7         </div>
8     </div>
9 </section>
#5
+
 /var/www/krgconorg/data/www/karfil.kz/protected/controllers/PostController.php(166): CController->render("view/gallery_view", array("model" => Post, "category" => Category, "mComment" => Comment, "is_comment" => false, ...))
161                             'category'=>$mCategory,
162                             'mComment'=>$mComment,
163                             'is_comment'=>$is_comment,
164                             'admin_update'=>$admin_update,
165                             'exfields'=>$exfields,
166                             'type'=>$type,
167                         ));
168                     }
169                     else{
170 
171                         $this->breadcrumbs = array(
#20
+
 /var/www/krgconorg/data/www/karfil.kz/index.php(12): CApplication->run()
07 defined('YII_DEBUG') or define('YII_DEBUG',true);
08 // specify how many levels of call stack should be shown in each log message
09 defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);
10 
11 require_once($yii);
12 Yii::createWebApplication($config)->run();
2024-03-28 13:35:32 Apache/2.4.6 (CentOS) mpm-itk/2.4.7-04 OpenSSL/1.0.2k-fips PHP/7.4.33 Yii Framework/1.1.14