We are currently using Kohana 3 for a staging application which is getting ready for production. We have few requirements to set custom routing and custom error codes. Most of the solutions offered in Kohana 3 suggests modifying bootstrap.php directly. Is that a best practice to do? In Kohana 2.x, they had something like routes.php as part of configuration. I believe that is replaced by regular expression routing in Kohana 3 which is placed inside bootstrap.php along with other out-of-box settings.
Please suggest the best practice followed by Kohana 3 community. I don't mind 开发者_高级运维changing bootstrap.php but wondering if there is any configuration files specifically for routing.
There is no single best practice. But if you have many routes (and usually you have), I suggest you to create a new file routes.php
in application
folder and include it in bootstrap.php
.
So instead of Route::set('default'...
in your bootstrap.php
you will have require_once APPPATH.'routes.php';
精彩评论