-1
我想弄清楚如何讓Silex中的錯誤處理程序呈現一個樹枝模板。這是他們在文檔中提供:在Silex中使用錯誤處理程序時,如何呈現樹枝模板?
$app->error(function (\Exception $e, Request $request, $code) {
return new Response('We are sorry, but something went terribly wrong.');
});
我寫的是:
$app->error(function (\Exception $e, Request $request, $code) {
return $app['twig']->render('error.twig');
});
我ASLO嘗試:
$app->error(function (\Exception $e, Request $request, $code) {
return new Response($app['twig']->render('error.twig'));
});
我找不到,通過這些方法去手動我本可以在Silex及其錯誤處理方面工作。