Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Route everything after?
  • Is is possible to do this?
    Say I have the following route configuration:
      'v1/session'  => 'rest/session',    'v1/session/create'  => 'rest/session/create',
      'v1/session/validate'  => 'rest/session/validate',
    Basically I just want to do one route and route everything after:
      'v1/session/(:any)'  => 'rest/session/$1',  

    But its doesn't work....

    Or I just have to define every route myself?
  • It should work. Can you elaborate more on what doesn't work? Does all but one route work? Or do all but one route work?
  • @philipptempel Thanks for the reply!  And sorry for my late reply....

    In Case 1:
    'v1/session/(:any)' => 'rest/session/$1'
    200 on http://localhost/v1/session/create
    returns get_create()

    200 on http://localhost/v1/session/validate
    returns be get_validate()

    In Case 2:
    'v1/session(/:any)' => 'rest/session/$1'

    200 on http://localhost/v1/session/create
    But returns get_index() , suppose to be get_create()

    200 on http://localhost/v1/session/validate
    Also returns get_index(), suppose to be get_validate()

    Either way I can't get the get_index page works.....
  • HarroHarro
    Accepted Answer
    Case 2 should be:

    'v1/session(:any)' => 'rest/session$1'
  • @Harro It's working perfect!  Thanks!

Howdy, Stranger!

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

In this Discussion