PHP warning

Creating default object from empty value

/var/www/html/uprav1/protected/controllers/SiteController.php(216)

204                 $model->tekst=preg_replace('/\[code\]/','',$model->tekst,1);
205                 $last = strrpos($model->tekst, '[/code]');
206                 $total = strlen($model->tekst) - 1;
207                 $stop = $last - $total+5;
208                 $model->tekst = substr_replace($model->tekst, '', $last-1, $stop);
209                 //$model->tekst=str_replace('[/code]','',$model->tekst);
210                 $menu = Menu::model()->findByPk($_GET['id']);
211                 $model->m_id = $model->id;
212             }
213             else
214             {
215                 $model = Statti::model()->findByPk($_GET['id']);
216                 $model->tekst=preg_replace('/\[code\]/','',$model->tekst,1);
217                 $last = strrpos($model->tekst, '[/code]');
218                 $total = strlen($model->tekst) - 1;
219                 $stop = $last - $total+5;
220                 $model->tekst = substr_replace($model->tekst, '', $last-1, $stop);
221                 //$model->tekst=str_replace('[/code]','',$model->tekst);
222                 $menu = Menu::model()->findByPk($model->m_id);
223                 $model->m_id = $_GET['id'];
224             }
225             
226             $this->layout='column2';
227             $this->render('stattya',array("model"=>$model,"menu"=>$menu));
228         }

Stack Trace

#12
+
 /var/www/html/uprav1/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-28 15:40:11 Apache/2.4.10 (Debian) Yii Framework/1.1.13