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
URL as param in a route
hamsddxn
December 2014
Hi,
i want to same a redirect like that
http://mysite/login?next=/en/dashboard.html
or
http://mysite/login?next=http://mysite/en/dashbord
and my route is 'login?next=(:url)' => 'admin/login/$1'
i can't thant the param url. can you help me?
Harro
December 2014
Accepted Answer
FuelPHP doesn't work with the URI QUERY_STRING, so that is not supported and will not work. It works with URI segments.
Both the query string and the extension will be stripped from the URI before a routing decision is made.
But it's simple to use
http://mysite/login/en/dashboard
and the route
'login(:next)' => 'admin/login',
You then define your method as
public function action_login($next = null) {}
and you can do what you want with the parameter.
hamsddxn
December 2014
'login(/:next)?'
Thanks, for always finding best answers
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
hamsddxn
December 2014
Harro
December 2014