You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 15, 2022. It is now read-only.
Hi!
Could you tell me how to make a 404 error page through your router. For example, instead of the plain text "404" on an empty page, another page was loaded - at /404/ with the same or its template?
For example, I create this page with path /404/:
Macaw::get('/404/', '\Controllers@error404Page');
In Controllers.php I add a function:
public function error404Page()
{
header($_SERVER['SERVER_PROTOCOL'] . " 404 Not Found");
$this->layout = Template::getInstance('error404.tpl');
$this->layout->set("title", "404 Error - Not found");
$this->layout->set("content", '404 Error: Oops! Nothing found');
echo $this->layout->output();
}
In this case, we open the page /404/, but it gives the code 200, since the router is specified.
Thanks!
The text was updated successfully, but these errors were encountered:
# for freeto subscribe to this conversation on GitHub.
Already have an account?
#.
Hi!
Could you tell me how to make a 404 error page through your router. For example, instead of the plain text "404" on an empty page, another page was loaded - at
/404/
with the same or its template?For example, I create this page with path
/404/
:Macaw::get('/404/', '\Controllers@error404Page');
In Controllers.php I add a function:
In this case, we open the page
/404/
, but it gives the code200
, since the router is specified.Thanks!
The text was updated successfully, but these errors were encountered: