Added to Favorites PHP Error

PHP Error

Cannot modify header information - headers already sent by (output started at /home/bfs/public_html/protected/controllers/EstateController.php:296)

/home/bfs/framework/web/CHttpRequest.php(657)

645     /**
646      * Redirects the browser to the specified URL.
647      * @param string $url URL to be redirected to. If the URL is a relative one, the base URL of
648      * the application will be inserted at the beginning.
649      * @param boolean $terminate whether to terminate the current application
650      * @param integer $statusCode the HTTP status code. Defaults to 302. See {@link http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html}
651      * for details about HTTP status code. This parameter has been available since version 1.0.4.
652      */
653     public function redirect($url,$terminate=true,$statusCode=302)
654     {
655         if(strpos($url,'/')===0)
656             $url=$this->getHostInfo().$url;
657         header('Location: '.$url, true, $statusCode);
658         if($terminate)
659             Yii::app()->end();
660     }
661 
662     /**
663      * Returns the user preferred language.
664      * The returned language ID will be canonicalized using {@link CLocale::getCanonicalID}.
665      * This method returns false if the user does not have language preference.
666      * @return string the user preferred language.
667      */
668     public function getPreferredLanguage()
669     {

Stack Trace

#2
+
 /home/bfs/public_html/protected/controllers/EstateController.php(309): CController->redirect("/")
304             //echo Yii::t('property','Deleted from Favorites');
305         }
306         if(isset($_GET['add']) || isset($_GET['del'])) {
307             if(!isset($_GET['ajax'])) {
308                 $referer = Yii::app()->request->getUrlReferrer();
309                 $this->redirect(is_null($referer) ? '/' : $referer);
310                 $this->render('_favorites');
311                 return;
312             } else {
313                 return;
314             }
#10
+
 /home/bfs/public_html/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();
2017-10-21 19:39:21 Apache Yii Framework/1.1.8