Welcome Guest, Not a member yet? Register   Sign In
how to hide controller method name in url
#1

[eluser]Wondering Coder[/eluser]
hi to all.,

anyone knows how to hide methods or function in a url?

i have this in my url:
Code:
localhost/spms/student/profile
localhost/spms/company
etc..

I just want the user to see this:
localhost/spms
#2

[eluser]R_Nelson[/eluser]
using the route file you can change the look of the route example:yoururl.com/site/about

Code:
$route['about'] = "site/about";

the route.php is in the config dir

the example above would now be called like yoururl.com/about

i hope that helps!
#3

[eluser]Wondering Coder[/eluser]
thanks for the reply.,
what if I have 5 controllers and in each controller I have at least 4 methods in it? Do I have to re route all my controllers? Is there any way around it?
#4

[eluser]toopay[/eluser]
Your option is using ajax(so the url is not change at all). If you want to do that in server-side, then your option is either using 'Route' or you can play with 'Hook' and manipulates the requested URI.




Theme © iAndrew 2016 - Forum software by © MyBB