CodeIgniter:显示自定义视图,而不是“数据库错误”消息 [英] CodeIgniter: Display custom view instead of 'Database Error' message
本文介绍了CodeIgniter:显示自定义视图,而不是“数据库错误”消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在数据库意外中断的情况下显示自定义视图,而不显示常规错误?
How Can I show a custom view instead of the generic error attached in cases of the database going down unexpectedly?
推荐答案
文件夹中有一个名为错误的文件夹。有发生错误时出现的所有错误文件
。
In applications folder there is a folder named errors. There are all error files
which comes up when an error is occurred.
当出现数据库错误时,浏览器中会显示 error_db.php 文件。您可以使用自定义文件进行编辑或替换。
When database error is occured, error_db.php file is shown in browser. You can edit it or replace that with your custom file.
希望这有助。
这篇关于CodeIgniter:显示自定义视图,而不是“数据库错误”消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文