我想使用controller.view500(err)并显示一个自定义的系统视图。
如何显示自定义系统视图500、400?
https://docs.totaljs.com/latest/en.html#api~FrameworkController~controller.view
谢谢
发布于 2017-01-18 14:41:39
函数view500实际上并不呈现任何视图。这只是throw500的别名。
如果你想渲染一个视图,你可以定义一个自定义路由,如下所示:
F.route('#500', function(){
// You need to create the view '500.html' file yourself in views folder
this.view('500');
});然后,每当您使用controller.view500();时,上述路由都会处理它。在路由控制器中,传递给view500的错误应该以controller.exception的形式出现
https://stackoverflow.com/questions/41708564
复制相似问题