PHP warning

Cannot modify header information - headers already sent by (output started at /var/www/zap-online/data/www/zap-online.ru/protected/controllers/automobiles/MarkaAction.php:2)

/var/www/zap-online/data/www/zap-online.ru/protected/controllers/automobiles/MarkaAction.php(130)

118             $vars['modific'] = $modific;
119             $vars['min_year'] = $min_year;
120             $vars['max_year'] = $max_year;
121 
122             $this->controller->render('model' , $vars);
123             die;
124         }elseif($slug != null){
125             $auto = Cars::model()->with('type', 'model')->findAll('t.slug = "'.$slug.'" AND t.species_id = "'.$spec_id.'"');
126             $vars['auto_name'] = isset($auto[0]) && $auto[0]->name != '' ? $auto[0]->name : '';
127             $type = CarsSpecies::model()->findByPk($spec_id);
128 
129             if(count($auto) == 0){
130                 header('HTTP/1.1 301 Moved Permanently');
131                 header('Location: '.$this->controller->createUrl('cars/index'));
132             }
133 
134             //перебрать список техники
135             $tehnika = array();
136             foreach($auto as $_auto){
137                 // если присутствуют можели тогда добавляем таб с техникой
138                 if(count($_auto->model) > 0)
139                     $tehnika[] = $_auto->type;
140             }
141 
142             // SEO

Stack Trace

#0
+
 /var/www/zap-online/data/www/zap-online.ru/protected/controllers/automobiles/MarkaAction.php(130): header("HTTP/1.1 301 Moved Permanently")
125             $auto = Cars::model()->with('type', 'model')->findAll('t.slug = "'.$slug.'" AND t.species_id = "'.$spec_id.'"');
126             $vars['auto_name'] = isset($auto[0]) && $auto[0]->name != '' ? $auto[0]->name : '';
127             $type = CarsSpecies::model()->findByPk($spec_id);
128 
129             if(count($auto) == 0){
130                 header('HTTP/1.1 301 Moved Permanently');
131                 header('Location: '.$this->controller->createUrl('cars/index'));
132             }
133 
134             //перебрать список техники
135             $tehnika = array();
#10
+
 /var/www/zap-online/data/www/zap-online.ru/index.php(19): CApplication->run()
14         defined('YII_DEBUG') or define('YII_DEBUG',true);
15     break;
16 }
17 
18 require_once($yii);
19 Yii::createWebApplication($config)->run();
2018-11-18 22:14:57 Apache/2.2.22 (Debian) Yii Framework/1.1.14