Welcome Guest, Not a member yet? Register   Sign In
using the 1st segment of the url
#1

[eluser]xeroblast[/eluser]
we all know that the 1st segment of the URL is the controller name like "http://domain.com/controller/method/params"...

how can i make the 1st segment in the URL be a data of the controller?

i.e.

http://domain.com/foo

and in the controller

Code:
function index($bar=NULL) {
if ($bar) {
  echo $bar; // display 'foo'
} else {
  echo 'blah';
}
}
#2

[eluser]GSV Sleeper Service[/eluser]
you could either set the default controller or set up a custom route. both are explained very well in the documentation.




Theme © iAndrew 2016 - Forum software by © MyBB