Slim 3 - Wie füge ich eine 404-Vorlage hinzu?

In Slim 2 kann ich die Standard-404-Seite leicht überschreiben,

// @ref: http://help.slimframework.com/discussions/problems/4400-templatespath-doesnt-change
$app->notFound(function () use ($app) {
    $view = $app->view();
    $view->setTemplatesDirectory('./public/template/');
    $app->render('404.html');
});

Aber in Slim 3,

// ref: http://www.slimframework.com/docs/handlers/not-found.html
//Override the default Not Found Handler
$container['notFoundHandler'] = function ($c) {
    return function ($request, $response) use ($c) {
        return $c['response']
            ->withStatus(404)
            ->withHeader('Content-Type', 'text/html')
            ->write('Page not found');
    };
};

Wie kann ich meine 404-Vorlage ('404.html') in hinzufügen?

Antworten auf die Frage(4)

Ihre Antwort auf die Frage