CodeIgniter Forums
replacing function name into a username - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: replacing function name into a username (/showthread.php?tid=21266)



replacing function name into a username - El Forum - 08-05-2009

[eluser]VinceVe[/eluser]
Hey guys I'm making a community site on CI, but now I'm having this problem:
I wnat to have mysite.com/profile/USERNAME. How can I get this ?

Thanks in advance.


replacing function name into a username - El Forum - 08-05-2009

[eluser]Phil Sturgeon[/eluser]
Read up on URI routing.


replacing function name into a username - El Forum - 08-05-2009

[eluser]VinceVe[/eluser]
If I use :any, does he ignore the not allowed URI characters ?


replacing function name into a username - El Forum - 08-05-2009

[eluser]Bramme[/eluser]
You could also use a _remap function! Though I agree, routes would be a better way. I do not know if :any ignores disallowed characters, you should try it out, but I don't think it will.


replacing function name into a username - El Forum - 08-05-2009

[eluser]Phil Sturgeon[/eluser]
:any is just replaced by the regular expression .+ so it means literally anything that it comes across.

This doesn't mean it will let disallowed characters through though. It just means it will match against anything that makes it past the route validation.