Posts tagged Routes
At first when I looked into using Kohana I was quite happy and comfortable to use it. As a matter of fact, I still am.
Routing was one thing that I had some trouble with.
Now I don’t know if it was because when I read through some of the articles online and/or forum posts that my mind was hazy with coffee… could be.
Recently I was once again into some code that had been worked on for a project using Kohana v3. And at once the issue of routes had come to mind….. I had always thought about making some kind of “catch all” to avoid errors and such for missing controllers…etc.
But while reading a bit (with a fresh cup of coffee I might add) it just struck me in a different way. I don’t know why I didn’t seem to understand it before…. but I now understood that I could set up various routes allowing access to controllers and also using a “catch all” of sorts. And the way Kohana uses it’s modules, I could create an init.php file inside each module directory to define the routes instead of messing with the bootstrap.php file.