PHP notice

Undefined offset: 20

/home/u439419125/domains/events.az/private_html/conf/common/models/Events.php(820)

808         
809         return $this;
810     }
811     
812     public function getSlug()
813     {
814         return ( !empty($this->{'slug_'.Yii::app()->language}) ) ? $this->{'slug_'.Yii::app()->language} : $this->{'title_'.Yii::app()->language};
815     }
816     
817     public function getColor($index = 0)
818     {
819         $colors = $this->colors;
820         return $colors[$index][rand(0, count($colors[$index]) - 1)];
821     }
822     
823     public function getFullDate($time = 'start_time')
824     {
825         $day = date('d', $this->$time);
826         $month = Yii::app()->MY->getMonthNameForLang( date('m', $this->$time) );
827         $year = date('Y', $this->$time);
828         $week = date('w', $this->$time);
829         
830         return $day.' '.$month.' '.$year.', '.Yii::t('main', 'week0'.$week);
831     }
832     

Stack Trace

#0
+
 /home/u439419125/domains/events.az/private_html/conf/common/widgets/views/frontlastevents.php(7): Events->getColor(20)
02     <!-- New-event start -->
03     <section id="new-events">
04         <div class="container">
05             <div class="count-desc">
06             <?php foreach( $model as $i=>$e ): $file = $e->eventsFiles(array('limit'=>1, 'order'=>'id DESC', 'scopes'=>'images')); if(count($file)): ?>
07                 <?php $bgColor = $e->getColor($i); ?>
08                 <div class="col-lg-2 col-md-2 col-sm-2 col-xs-12">
09                     <div class="new-e">
10                         <a href="<?=Yii::app()->createUrl('events/'.$e->id, array('slug'=>$e->getSlug()))?>">
11                             <img src="/files/events/<?=$e->id?>/<?php echo $file[0]['name'];?>"><?php /* <?=$file[0]->getImageUrl('main', false, 160, 200)?> */?>
12                             <div class="new-title">
#4
+
 /home/u439419125/domains/events.az/private_html/conf/common/widgets/FrontLastEvents.php(22): CWidget->render("frontlastevents", array("model" => array(Events, Events, Events, Events, ...), "title" => false))
17                 $model = $this->model;
18             
19             $this->render($this->renderFile, array(
20                 'model'=>$model, 
21                 'title'=>( is_null($this->model) ) ? true : false
22             ));
23         }
24     }
25     
26 ?>
#6
+
 /home/u439419125/domains/events.az/private_html/conf/frontend/protected/views/site/more/mcategory.php(32): CBaseController->widget("common.widgets.FrontLastEvents", array("model" => array(Events, Events, Events, Events, ...)))
27     Yii::app()->clientScript->registerMetaTag($model->{'name_'.Yii::app()->language},null,null,array('property'=>'og:title'));
28     Yii::app()->clientScript->registerMetaTag($this->defaultOgDesc, 'description');
29     Yii::app()->clientScript->registerMetaTag($this->defaultOgDesc,null,null,array('property'=>'og:description'));
30     Yii::app()->clientScript->registerMetaTag($this->defaultOgImage,null,null,array('property'=>'og:image'));
31 ?>
32         <?php $this->widget('common.widgets.FrontLastEvents', array('model'=>$selectedEvents)); ?>
33 
34 
35 <section id="tab">
36     <div class="event-tab">        
37         <div class="container">
2024-03-19 11:18:31 LiteSpeed Yii Framework/1.1.13