Error

Non-static method Menu::getMenuByPath() cannot be called statically

/customers/a/d/7/psht-venlo.nl/httpd.www/protected/controllers/SiteController.php(126)

114                 $subject='=?UTF-8?B?'.base64_encode($model->subject).'?=';
115                 $headers="From: $name <{$model->email}>\r\n".
116                     "Reply-To: {$model->email}\r\n".
117                     "MIME-Version: 1.0\r\n".
118                     "Content-type: text/plain; charset=UTF-8";
119 
120                 mail(Yii::app()->params['adminEmail'],$subject,$model->body,$headers);
121                 Yii::app()->user->setFlash('contact','Thank you for contacting us. We will respond to you as soon as possible.');
122                 $this->refresh();
123             }
124         }
125         // retrieve the active menu object
126         $menu = Menu::getMenuByPath('site/contact');
127 
128         if($menu === null) {
129             throw new CHttpException(404, Yii::t('content', 'Oops, something goes wrong searching this page.'));
130         }
131 
132         // retrieve the article from the AR
133         $articles=Article::getArticlesByMenuId($menu->id);
134         $this->menuId = $menu->id;
135 
136         // renders the view file 'protected/views/site/article.php'
137         // using the default layout 'protected/views/layouts/main.php'
138         $content = $this->renderPartial('article',array('articles'=>$articles),true);

Stack Trace

#7
+
 /customers/a/d/7/psht-venlo.nl/httpd.www/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:14:16 Apache Yii Framework/1.1.14