Love Fuel?
Donate
About
Forums
Discussions
Login
FuelPHP Forums
Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
General
Route everything after?
kchan4
August 2015
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?
philipptempel
August 2015
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?
kchan4
August 2015
@philipptempel
Thanks for the reply! And sorry for my late reply....
In Case 1:
'v1/session/(:any)' => 'rest/session/$1'
404 on
http://localhost/v1/session/
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'
404 on
http://localhost/v1/session/
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.....
Harro
August 2015
Accepted Answer
Case 2 should be:
'v1/session(:any)' => 'rest/session$1'
kchan4
August 2015
@Harro
It's working perfect! Thanks!
Add a Comment
Howdy, Stranger!
It looks like you're new here. If you want to get involved, click one of these buttons!
Sign In
Apply for Membership
Categories
All Discussions
5,088
General
↳ General
3,364
↳ Job Board
13
↳ Installation & Setup
214
Packages
↳ Oil
213
↳ Orm
700
↳ Auth
260
Development
↳ Tips and Tutorials
126
↳ Code share
145
↳ Applications
52
In this Discussion
Harro
August 2015
kchan4
August 2015
philipptempel
August 2015