Error

Call to a member function getPath() on null

/protected/modules/web/controllers/ContentsController.php(105)

093     protected function setLayout() {
094 
095         $getLayout = Yii::app()->request->getParam('layout');
096 
097         if( isset( $getLayout ) ){
098             $layouts = array_filter(array_keys($this->model->findLayouts()));
099             if( in_array( $getLayout, $layouts ) ) {
100                 $this->layout = $getLayout;
101                 return true;
102             }
103         }
104 
105         $path = array_reverse( $this->model->getPath() );
106 
107         if( is_array( $path ) ) {
108 
109             foreach( $path as $k => $model ) {
110                 if( $model->con_layout ) {
111                     $this->layout = $model->con_layout;
112                     return true;
113                 }
114             }
115 
116         }
117 

Stack Trace

#0
+
 /protected/modules/web/controllers/ContentsController.php(41): ContentsController->setLayout()
36         $model = new CmsContents();
37         $this->model = $model->getInfo( $id, 1, 1, 1 );
38         $this->setElement($this->model->id_con);
39 
40         $this->registerSeo( $this->model );
41         $this->setLayout();
42         $_GET['attr'] = $this->model->description->web->web_url;
43 
44         if( sizeof( $this->model ) === 0 )
45             throw new CHttpException( 404, Yii::t( 'yii','Unable to resolve the request "{route}".', array('{route}'=>$_GET['lang'].'/'.$_GET['attr']) ) );
46 
#10
+
 /index.php(22): CApplication->run()
17     defined( 'YII_DEBUG' ) or define( 'YII_DEBUG', true );
18 }
19 defined( 'YII_TRACE_LEVEL' ) or define( 'YII_TRACE_LEVEL', 2 );
20 
21 require_once( $yii );
22 Yii::createWebApplication( $config )->run();
2024-03-29 01:20:58 IdeaWebServer/5.4.0 (like Apache) Yii Framework/1.1.19