首页›HTTP 响应›Code404
Code404
默认 404 错误页
类定义
namespace Kuoqi\Core\Response;
class Code404 extends Behavior {
protected $STATUS_CODE = 404;
public function __construct(){
parent::__construct();
$this->stream = sprintf(
"<h2 style=\"text-align: center;margin-top: 1em;margin-bottom: 0.25em;\">404 Not Found</h2><div style=\"text-align: center;\">Power By KuoqiPHP.%s</div>",
\Kuoqi::$VERSION
);
}
public function flush(){
parent::flush();
}
}行为要点
- 构造即预置默认 404 HTML(Power By 版本号)
- 可用 setStream 覆盖内容
- WebController::code404($stream) 快速调用
- Exception::quit() 的 Web 分支渲染的也是 404 页
KuoqiPHP v1.05 · 离线静态文档 · 界面基于 KuoqiUI ·
返回首页