【发布时间】:2019-12-08 12:44:16
【问题描述】:
我正在更改我的 slim 框架 v2 上的默认 404 错误页面。
这是我正在使用的代码:
$app->notFound(function () use ($app) {
$app->render('404.html');
});
但是,我收到了这个错误:
Message: View cannot render `404.html` because the template does not exist
我的 404.html 文件与我的 index.php 位于同一文件夹中,其中包含 Slim 代码。另外,为了检查,我也将 404.html 文件复制到了我的 slim 文件夹中。不过,我遇到了同样的错误。有没有跟模板有关的东西?
【问题讨论】: