PHP warning

Invalid argument supplied for foreach()

/home/user1178644/www/overlock.by/protected/modules/page/views/catalog/index.php(129)

117 ?></div>
118 </div>
119 
120 <?php if (isset($leftNav)){ ?>
121 
122         <?php
123         $res = array();
124         $first = true;
125         foreach ($leftNav as $item)
126         {
127                 if ($first) { $first = false; }
128                 $res[] = CHtml::link($item['name'], '/catalog/'.$item['path'] );
129                 foreach ($item['sub'] as $sub)
130                 {
131                     $res[] = CHtml::link($sub['name'], '/catalog/'.$item['path'].'/'.$sub['path'] );
132                 }
133         }
134         $sep = count ($res) / 4;
135         ?>
136     <nav class="bottom">
137 
138         <div class="_b-header-nav-dropdown-body">
139             <div class="_b-header-nav-dropdown-body-h">
140                 <div class="_b-header-nav-dropdown-col">
141                     <div class="_b-header-nav-dropdown-list">

Stack Trace

#3
+
 /home/user1178644/www/overlock.by/protected/components/web/Controller.php(35): CController->renderPartial("index", array("CATALOG_TEXT" => "", "onMainPage" => false, "model" => Goods, "leftNav" => array(array("name" => "Шпульки", "path" => "accessories/kupit-shpulki", "sub" => null)), ...), true, false)
30     }
31 
32     public function renderPartial($view, $data = null, $return = false, $processOutput = false)
33     {
34         $data = empty(Yii::app()->response->data) ? $data : array_merge(Yii::app()->response->data, (array) $data);
35         return parent::renderPartial($view, $data, $return, $processOutput);
36     }
37     public function beforeRender(){
38         
39         $paged = !(strpos( $_SERVER['REQUEST_URI'] , '?' ) === false );
40         
#5
+
 /home/user1178644/www/overlock.by/protected/modules/page/controllers/CatalogController.php(341): CController->render("index", array("CATALOG_TEXT" => "", "onMainPage" => false, "model" => Goods, "leftNav" => array(array("name" => "Шпульки", "path" => "accessories/kupit-shpulki", "sub" => null)), ...))
336              Yii::app()->params['onMainPage'] = $onMainPage;
337              $vars['model']  = $model;
338              $vars['leftNav'] = $leftNav;
339              $vars['pclass']  = $pclass;
340              //print_r($vars);
341                 $this->render('index', $vars );
342     }
343 
344     // Uncomment the following methods and override them if needed
345     /*
346     public function filters()
#15
+
 /home/user1178644/www/overlock.by/index.php(15): CApplication->run()
10 require_once(__DIR__.'/protected/config/env-local.php');
11 
12 
13 require_once($yii);
14 
15 Yii::createWebApplication($config)->run();
16 //Yii::endProfile('blockID');
2024-03-19 14:13:50 Apache/2.2.26 (Unix) PHP/5.3.28 mod_fcgid/2.3.9 Yii Framework/1.1.15