Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Routing issue
  • One thing i'm bothered with with FuelPHP is that the Router overwrites existing controllers. What i mean is that when i add a controller named i.e. foo and i would then add a route and point it to everything in the url, the router will then say 'oh i found a route for that' - and skips the step to look for the controller. I'm dutch and i'm afraid the above is a bit unclear, but this is what i mean: http://example.com/about-us should point to controller => page, action => show, param => slug => about-us
    But
    http://example.com/foo should point to controller => foo, action => index.. Am I missing something or is this simply not possible with the current router? I think the order of processing should be changed and the router should first look for a controller and then a route. Anybody else experiencing this or am i missing something?
  • What do you expect? While driving you tell your wife to take a right turn, and you expect her to go left anyway, since that crossing has a left turn too? This is what routing does, it tells FuelPHP how to route URI requests. Searching for a controller is only a last resort, if no route match is found. Every framework works like this, it would be a disaster if it didn't. If you want to route http://example.com/about-us to one controller, but http://example.com/foo not, don't define an :any route for it.
  • Oke. Thank you for your reaction. I think i get it..
  • Cool. :) Let me know if you have more questions (which I can answer in Dutch if you want if you PM me on IRC) ...

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion