PHP warning

Cannot modify header information - headers already sent by (output started at /home/bangsaonline/public_html/global.php:1)

/home/bangsaonline/public_html/protected/views/front/site/sitemap_news.php(2)

01 <?php 
02 header("Content-type: text/xml");
03 
04 $baseUrl = Yii::app()->request->hostInfo . Yii::app()->request->baseUrl;
05 ?>
06 <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:news="http://www.google.com/schemas/sitemap-news/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">
07   
08     <?php foreach ($model as $key => $value): ?>
09     <?php if($value['news_type'] == 1){
10         $link = "berita";
11     } elseif($value['news_type'] == 3){
12         $link = "berita-video";
13     }
14     

Stack Trace

#0
+
 /home/bangsaonline/public_html/protected/views/front/site/sitemap_news.php(2): header("Content-type: text/xml")
1 <?php 
2 header("Content-type: text/xml");
3 
4 $baseUrl = Yii::app()->request->hostInfo . Yii::app()->request->baseUrl;
5 ?>
6 <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:news="http://www.google.com/schemas/sitemap-news/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">
7   
#4
+
 /home/bangsaonline/public_html/protected/controllers/front/SiteController.php(183): CController->renderPartial("sitemap_news", array("model" => array(array("news_id" => "161842", "news_title" => "Sengketa Tanah Waris di Tegalbang Tuban Berakhir Damai, Ahli War...", "news_slug" => "sengketa-tanah-waris-di-tegalbang-tuban-berakhir-damai-ahli-wari...", "news_meta_keyword" => null, ...), array("news_id" => "161841", "news_title" => "YBM PLN Salurkan Bantuan Ternak Kambing untuk Buruh Serabutan di...", "news_slug" => "ybm-pln-salurkan-bantuan-ternak-kambing-untuk-buruh-serabutan-di...", "news_meta_keyword" => null, ...), array("news_id" => "161840", "news_title" => "Kemenhaj Lakukan Sejumlah Langkah Perkuat Layanan Haji dan Perli...", "news_slug" => "kemenhaj-lakukan-sejumlah-langkah-perkuat-layanan-haji-dan-perli...", "news_meta_keyword" => null, ...), array("news_id" => "161839", "news_title" => "​Fajrul Falah, Calon Dokter Muda Pergi Haji Gantikan Almarhum ...", "news_slug" => "​fajrul-falah-calon-dokter-muda-pergi-haji-gantikan-almarhum-a...", "news_meta_keyword" => "Haji 2026, kemenhaj, kemenag, jemaah haji, embarkasi, haji klote...", ...), ...)))
178             Yii::app()->cache->set('sitemapCache', $news, 30);
179         //}else{
180          //       $news = $sitemap_cache;
181         //}
182 
183         $this->renderPartial('sitemap_news',array('model'=>$news));
184         exit;
185     }
186 
187     
188      public function actionSitemapxmlkanal()
#12
+
 /home/bangsaonline/public_html/protected/components/WebApplicationEndBehavior.php(25): CApplication->run()
20         // Attach the changeModulePaths event handler
21         // and raise it.
22         $this->onModuleCreate = array($this, 'changeModulePaths');
23         $this->onModuleCreate(new CEvent($this->owner));
24  
25         $this->owner->run(); // Run application.
26     }
27  
28     // This event should be raised when CWebApplication
29     // or CWebModule instances are being initialized.
30     public function onModuleCreate($event)
2026-05-09 16:07:53 Apache Yii Framework/1.1.14