I am working with kohana, because development goes so pretty fast. Now I want to achieve something which I can't really think of a workaround for.
What I want to achieve, there is a controller. It's called Controller_Restaurants
But those restaurants, are grouped by provinces and after province is clicked they are grouped by a city, and then a list of the restaurants is shown up.
All cities and provinces are already added to there specific database with fields.
I want to create a route in my controller. So can I achieve a following link:
domain/restaurants/province/city/restaurant-name
?
Or am I thinking like a douche and should I solve this otherwise?
It is possible to create routes inside a controller in Kohana, but it won't help you solve your problem because routing has already happened.
What you need to do is create a route with optional parameters as suggested by @kingkero:
Then access the parameters in the URL from the controller like so:
Build your routing like this:
It should work like this.