在項目根目錄 public/ 下建立 404.html(或 .tpl),內容自定義。
// action.class.php
static public function _404() {
header("HTTP/1.0 404 Not Found");
header("Status: 404 Not Found");
$my = new self();
$my->display('public/404');
}
編輯 brophp/brophp.php,在載入控制器文件判斷後添加:
$srccontrolerfile = APP_PATH . "controls/" . strtolower($_GET['m']) . ".class.php";
if (!file_exists($srccontrolerfile)) {
Action::_404();
}
編輯 action.class.php,在提示「沒有該操作」的代碼前/後添加:
self::_404();