Error

Using $this when not in object context

/home/ndtvietnam/public_html/protected/models/Seo.php(159)

147                 'pagesize' => Yii::app()->params['defaultPageSize'],
148             )
149         ));
150     }
151     
152     public function getSeo($page, $arr = null)
153     {
154         $row = self::model()->find(array(
155         'condition' => 'type = ' . $page,
156         ));
157         if (!empty($row))
158         {
159             $this->pageTitle = ((!empty($arr['title']))?($arr['title'] . ' '):'') . $row->keyword;
160             $this->keyword = ((!empty($arr['keyword']))?($arr['keyword'] . ' '):'') . $row->meta_keyword;
161             $this->description = ((!empty($arr['description']))?($arr['description'] . ' '):'') . $row->meta_description;
162             return true;
163         }
164         else 
165         {
166             return false;
167         }
168     }
169 
170     public function getSeoByType($type_id)
171     {

Stack Trace

#0
+
 /home/ndtvietnam/public_html/protected/controllers/SiteController.php(396): Seo::getSeo(2, array("title" => null, "description" => " - ", "keyword" => null))
391             $arr_seo = array(
392                 'title' => $model->name,
393                 'description' => ($model->name . ' - ' . myExt::getBrief($model->brief)),
394                 'keyword' => $model->name
395                 );
396             Seo::getSeo(Seo::PRODUCT_PAGE, $arr_seo);
397         }
398         $this->og_title = $model->name;
399         $this->og_description = myExt::getBrief($model->brief);
400         $this->og_type = 'article';
401         if (!empty($model->imgs)) {
#10
+
 /home/ndtvietnam/public_html/index.php(14): CApplication->run()
09 defined('YII_DEBUG') or define('YII_DEBUG',true);
10 // specify how many levels of call stack should be shown in each log message
11 defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);
12 
13 require_once($yii);
14 Yii::createWebApplication($config)->run();
2024-03-29 01:10:29 LiteSpeed Yii Framework/1.1.17