【问题标题】:Debugging routes in codeigniter?在codeigniter中调试路由?
【发布时间】:2012-09-08 21:32:26
【问题描述】:

我想知道代码点火器中是否有任何简单的方法可以调试路由?

最好我希望能够在日志中看到以下内容:

Client sent : apps/something
Route found : apps/(:any) --> applications/searchbyname/$1
Redirecting : apps/something --> applications/searchbyname/something
//and just cause we can lets make the searchbyname function not exist
ERROR - 2012-09-16 22:10:05 --> 404 Page Not Found --> applications/searchbyname/something

基本上,这意味着我们可以看到我们何时到达路线以及尝试加载的位置。

有什么方法可以实现这些方面的功能吗?

【问题讨论】:

    标签: php debugging codeigniter logging codeigniter-routing


    【解决方案1】:

    刚刚写了一个Router核心系统类的小扩展:

    https://github.com/Philo01/CodeIgniter-Route-Debugging

    它将按照您描述的方式进行调试。 (除了404,我还需要补充一下)

    【讨论】:

    • 404 应该由 CI 的日志自动处理。
    猜你喜欢
    • 1970-01-01
    • 2016-10-30
    • 1970-01-01
    • 2019-06-12
    • 2010-11-20
    • 2011-07-08
    相关资源
    最近更新 更多