Welcome Guest, Not a member yet? Register   Sign In
Profile Pages with URL
#1

[eluser]breastfed[/eluser]
Hello,

i am trying to get Information about the following Situation.

I have a Login where User can register on the Page.
Now i want them to be available though: domain.com/username

How would i achieve this?

Thank you for help!
#2

[eluser]Michael Wales[/eluser]
URI Routing
#3

[eluser]Phil Sturgeon[/eluser]
Routing is the most simple method, but has a few problems. You'd need to restrict usernames to make sure there would never be any controller conflicts, which means right at the start of your app you have to think of every possible controller you might want to add in.

There is a good post on a few other methods of doing this here.
#4

[eluser]breastfed[/eluser]
Thank you Guys, i will follow the Thread in the Link.
#5

[eluser]drewbee[/eluser]
Personally I would rather create a subdirectory user and make all the available controllers in there.

Is it really that big of a deal between

site.com/franknbeans
and
site.com/user/franknbeans
?
#6

[eluser]Phil Sturgeon[/eluser]
[quote author="drewbee" date="1241809517"]Personally I would rather create a subdirectory user and make all the available controllers in there.

Is it really that big of a deal between

site.com/franknbeans
and
site.com/user/franknbeans
?[/quote]

You mean set up a route an have user/ as an extra namespace? Nobody is setting up controllers for each user here, that would be slightly insane.

This conversation should be continued in the link provided, people have gone over the pro's and con's to each method and explained its purpose.
#7

[eluser]drewbee[/eluser]
[quote author="Phil Sturgeon" date="1241812742"][quote author="drewbee" date="1241809517"]Personally I would rather create a subdirectory user and make all the available controllers in there.

Is it really that big of a deal between

site.com/franknbeans
and
site.com/user/franknbeans
?[/quote]

You mean set up a route an have user/ as an extra namespace? Nobody is setting up controllers for each user here, that would be slightly insane.

This conversation should be continued in the link provided, people have gone over the pro's and con's to each method and explained its purpose.[/quote]

What? No. Not a route for each user. A controller for every user action as standard CI is used.

$route['user/:any:/:any'] = 'user/$2/$1';

/user/franknbeans/profile



remap would simply have to switch around the username and the method, then pass any further attributes in. Seems like it would be the most efficient method to me. No routing needed either.




Theme © iAndrew 2016 - Forum software by © MyBB