CodeIgniter Forums
Quick Question - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: Quick Question (/showthread.php?tid=9710)



Quick Question - El Forum - 07-06-2008

[eluser]Unknown[/eluser]
Hey there, downloaded CI about an hour ago and have been messing with it

Is there a way to set a 'default' function the same as __call() from php5? I tried but it wouldn't work. Basically is there a way to set a default function in the controller, but still have variables from the url, such as:

demo.com/user/Jack

Instead of calling a 'Jack' function, it'd call another one (say, User::ShowUser) and I'd be able to retrieve the name

The reason I ask is because having something like 'demo.com/user/profile/Jack' seems long. If there isn't a way I'll just go with that.


Quick Question - El Forum - 07-06-2008

[eluser]Unknown[/eluser]
Damn I'm blind. Found it here: http://ellislab.com/codeigniter/user-guide/general/routing.html