Error

Using $this when not in object context

/home/haipharco/public_html/protected/models/News.php(137)

125         $criteria->compare('rights',$this->rights);
126 
127         return new CActiveDataProvider(get_class($this), array(
128             'criteria'=>$criteria,
129             'sort'=>array('defaultOrder'=>'t.id DESC'),
130             'pagination' => array('pagesize' => Yii::app()->params['defaultPageSize']),
131         ));
132     }
133     
134     public function getOrther()
135     {
136         return self::model()->with('lang')->findAll(array(
137         'condition' => 't.active = 1 AND t.cat_id = ' . $this->cat_id . ' AND lang.code like "' . Yii::app()->session['lang'] . '"',
138         'order' => 't.id DESC',
139         'limit' => 4,
140         ));
141     }
142     
143     public function getLastest()
144     {
145         return self::model()->with('lang')->findAll(array(
146         'condition' => 't.active = 1 AND lang.code like "' . Yii::app()->session['lang'] . '"',
147         'order' => 't.id DESC',
148         'limit' => 3,
149         ));

Stack Trace

#0
+
 /home/haipharco/public_html/protected/views/site/pages/news.php(40): News::getOrther("42", "8")
35                         <div class="fb-like" data-href="http://<?php echo $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; ?>" data-layout="button_count" data-action="like" data-show-faces="true" data-share="true" style="display: inline-block;"></div>
36                         <div style="display: inline-block;"><script src="https://apis.google.com/js/plusone.js"></script><g:plus action="share" annotation="bubble"></g:plus></div>
37                     </div>
38 
39                     <?php
40                     $orther = News::getOrther($model->id, $model->cat_id);
41                     if (count($orther) > 0)
42                     {
43                         ?>
44                         <div class="related_news_page">
45                             <p><strong><?php echo Yii::t('app', 'related_news'); ?></strong></p>
#5
+
 /home/haipharco/public_html/protected/controllers/SiteController.php(330): CController->render("pages/news", array("model" => News))
325                 $this->menu=$menu[0]->id;
326                 if($menu[0]->parent!=0)
327                     $this->menu=$menu[0]->parent;
328             }
329         }
330         $this->render('pages/news', array('model' => $model));
331     }
332 
333     public function actionListNews($id, $name)
334     {
335         $conf = Configure::getConfigure();
#15
+
 /home/haipharco/public_html/index.php(15): CApplication->run()
10 defined('YII_DEBUG') or define('YII_DEBUG',true);
11 // specify how many levels of call stack should be shown in each log message
12 defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);
13 
14 require_once($yii);
15 Yii::createWebApplication($config)->run();
2024-03-28 22:34:27 LiteSpeed Yii Framework/1.1.17