Answer the question
In order to leave comments, you need to log in
Why doesn't sending headers work?
In the application class, I call the controller
following response->send () - sending headers.
send():
public function send(){
$status = isset($this->http_messages[$this->http_status])? $this->http_messages[$this->http_status] : $this->http_status;
if(!headers_sent()){
if(isset($_SERVER['SERVER_PROTOCOL'])){
header($_SERVER['SERVER_PROTOCOL']. ' ' .$status, true);
}
else{
header('HTTP/1.1 '.$status, true);
}
}
}
App::start(){
$controller->action() - тут отправляются заголовки( установка кук и т.д)
$response->send();
}
Answer the question
In order to leave comments, you need to log in
You have if(!headers_sent()) there ...
Apparently, some headers are sent earlier.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question