Add 404 error handler and update permission data structure

This commit is contained in:
Kijin Sung 2020-06-18 14:13:23 +09:00
parent e20c06bf00
commit 5fa72f8629
7 changed files with 49 additions and 29 deletions

View file

@ -156,6 +156,13 @@ class Router
$allargs = array_merge(['mid' => $prefix, 'act' => $internal_url], $args);
return (object)['status' => 200, 'url' => $url, 'args' => $allargs];
}
// If the module defines a 404 error handler, call it.
if ($internal_url && isset($action_info->error_handlers[404]))
{
$allargs = array_merge(['mid' => $prefix, 'act' => $action_info->error_handlers[404]], $args);
return (object)['status' => 200, 'url' => $url, 'args' => $allargs];
}
}
}