<?php
// send status line
header($response->status->get(), true, $response->status->getCode());
// send non-cookie headers
foreach ($response->headers->get() as $label => $value) {
header("{$label}: {$value}");
}
// send cookies
foreach ($response->cookies->get() as $name => $cookie) {
setcookie(
$name,
$cookie['value'],
$cookie['expire'],
$cookie['path'],
$cookie['domain'],
$cookie['secure'],
$cookie['httponly']
);
}
// send content
echo $response->content->get();
?>
$this->response->redirect->to( $slug, 302 );
echo $this->response->status->getCode()
I'm using Aura.Web and am trying to redirect a user to another page within the website.
At the end of my bootstrap.php i have the following:
<?php
// send status line
header($response->status->get(), true, $response->status->getCode());
// send non-cookie headers
foreach ($response->headers->get() as $label => $value) {
header("{$label}: {$value}");
}
// send cookies
foreach ($response->cookies->get() as $name => $cookie) {
setcookie(
$name,
$cookie['value'],
$cookie['expire'],
$cookie['path'],
$cookie['domain'],
$cookie['secure'],
$cookie['httponly']
);
}
// send content
echo $response->content->get();
?>
Within a controller i have:
$this->response->redirect->to( $slug, 302 );
This doesn't resolve it the expected behaviour.
When i debug:
echo $this->response->status->getCode()