Welcome Guest, Not a member yet? Register   Sign In
Username for Controller

[quote author="bbabics" date="1287592782"]Hello,

I'm trying to figure out how some sites display a username for their profile page (e.g. http://www.foobar.com/johndoe). Would you just define a controller and all the actions for the profile and simply when a new user is added their username become a controller that extends your profile controller?

I'm sure it's a simple question, but it perplexes me at the moment.


I generally break out profile into a separate controller. And I'm not sure how you're handling login, but I generally stuff some user info into a session variable. One piece of info is the userid, which just comes from ID of that particular user from the users table. since I have that in session, I go to www.domain.com/profile and the index function of the profile controller sucks the userid out of the session variable. This way, you don't have to start putting usernames in the URL and all that.

Messages In This Thread
Username for Controller - by El Forum - 10-20-2010, 05:39 AM
Username for Controller - by El Forum - 10-20-2010, 07:26 AM
Username for Controller - by El Forum - 10-20-2010, 09:04 AM

Theme © iAndrew 2016 - Forum software by © MyBB