How I can handle my 404 custom page (and possibly other errors)?
I just tried in routing part to add
GET /@codes /WebController->error
You don't have to define a route for this. F3 will automatically generate a 404 status code for any non-defined route.
If you want to define a custom error page, you need to set the ONERROR variable.
Here's a quick example:
$f3->route('GET /','App->home');
$f3->set('ONERROR',function($f3){
echo \Template::instance()->render('error.html');
});
$f3->run();
with error.html defined as:
{{@ERROR.text}}
{{@ERROR.text}}
Error code: {{@ERROR.code}}