PHP notice

Undefined variable: model

/home/pi888/public_html/protected/controllers/DrugsTestimonialsController.php(222)

210     {
211         $lang = Yii::app()->language;
212         $id = DrugsTestimonials::findByLSlug($slug, $lang);
213         if($id){
214             $model=DrugsTestimonials::model()->findByPk($id);
215 
216             // if($model->active == 0){
217             //     throw new CHttpException(404,'The requested page does not exist.');
218             // }
219         } 
220             
221 
222         if($model===null)
223             throw new CHttpException(404,'The requested page does not exist.');
224         return $model;
225     }
226 }

Stack Trace

#0
+
 /home/pi888/public_html/protected/controllers/DrugsTestimonialsController.php(72): DrugsTestimonialsController->loadModelBySlug("levitra-super-active-erfahrungen.html")
67         
68         if($slug !== strtolower($slug)){
69             throw new CHttpException(404,'The requested page does not exist.');
70         }
71         
72         $model = $this->loadModelBySlug($slug);
73 
74         $model->title = Filter::generic($model->title);
75         $model->description = Filter::generic($model->description);
76         $model->header = Filter::generic($model->header);
77         $model->subheader = Filter::generic($model->subheader);
#15
+
 /home/pi888/public_html/index.php(54): CApplication->run()
49 
50 // change the following paths if necessary
51 $yii=dirname(__FILE__).'/framework/yii.php';
52 
53 require_once($yii);
54 Yii::createWebApplication($config)->run();
2024-03-28 05:18:19 Apache/2.4.57 (Unix) OpenSSL/1.0.2k-fips Yii Framework/1.1.14