PHP notice

Undefined index: id

/var/www/vhosts/val.ua/protected/controllers/SiteController.php(41)

29 
30 
31     public function getMenu() {
32        return NewsCategory::model()->findAll();
33     }
34 
35     public function init() {
36 
37         $url = explode("/", Yii::app()->request->requestUri);
38         $categoryId = null;
39 
40         if(in_array('category', $url)){
41             $categoryId = $_GET['id'] ? $_GET['id'] : null;
42         }
43 
44         $this->menu = $this->getMenu();
45         $this->categoryId = $categoryId;
46 
47         return $this->menu;
48 
49     }
50 
51     /**
52      * This is the default 'index' action that is invoked
53      * when an action is not explicitly requested by users.

Stack Trace

#3
+
 /var/www/vhosts/val.ua/index.php(14): CApplication->run()
09 defined('YII_ENABLE_EXCEPTION_HANDLER') or define('YII_ENABLE_EXCEPTION_HANDLER',true);
10 
11 // specify how many levels of call stack should be shown in each log message
12 defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL', 3);
13 require_once($yii);
14 Yii::createWebApplication($config)->run();
2024-03-19 10:00:38 nginx/1.14.0 Yii Framework/1.1.14