html - Php headers not working, headers not sent -


i'm coding template engine, herefor i've made function:

public function getfilename() {     $config = new config('template_config.ini');     if($this->filepath == null){         $this->filename = $config->get("file")["default"];     }else{         if(array_key_exists($this->filepath, $config->get("file"))){             $this->filename = $config->get("file")[$this->filepath];         } else {             redirect::to("/404");             return $this;         }     }     return $this; } 

the code ran fine, until didn't anymore. runs right box , runs redirect function equal to: header("location: ".$input); exit;. after header echo's out things fine, header not linking through.

this called in index:

use lib\template\template_loader; use lib\api\input; require_once("nytrix/autoloader.php"); new template_loader(input::get("path")); 

then calls constructor, calls filename function:

public function __construct($filepath){     $this->filepath = $filepath;     $this->getfilename();  } 

the redirect::to($argument); function is: header("location: ".$argument);. no laravel implemented

this code little off. calling redirect::to("/404"); doesn't set headers or anything. generates illuminate\http\redirectresponse object needs returned controller.


Comments