Welcome Guest, Not a member yet? Register   Sign In
class method from another class
#9

[eluser]Michael Wales[/eluser]
Quote:Question, so I can create some session userdata within the library, but what I want that a view, for example the user account where he can see his account details like his account number, his current used email address etc etc ..

This is the beauty of MVC - separation. Account number, email address, all of this is data. The view has absolutely no impact on this data, there is no correlation, it doesn't matter, no one cares, don't mention the two in the same sentence, don't think of the two at the same time. You could pump out email addresses to HTML views, RSS views, JSON views, an LED controller plugged into Frankenstein's ass making him fart in morse code - doesn't matter. Data has nothing to do with views. Now, I don't want you using the two of them in the same paragraph every again - stop it.

Quote:This view is only accessible if he’s logged in, so I could (correct me if I’m wrong) use a controller for this were I call the authentication and if he’s not logged in I redirect (or use an error message) the user/visitor?

Exactly! That's the point - your controller handles the request from the user. The user shouldn't have to decide if they are logged in or not, that's your applications problem.

Quote:User: Hey, can I look at the information you have about me?
Controller: I hear you - let me go check with my main man Authentication, see if you've identified yourself.
Authentication: Straight up fo' reals home-dog - he's mos-def user, ya heard?
Controller: Okay... wierdo. Hey User, yeah I'm gonna let you check this out. Let me just go get your file from that hot-chick down in Models, man I love seeing her. BRB
Model: Oh hey baby - when we gonna go out again? I had such a good time last week. Oh, strictly business huh? This better not be one of your girlfriends! Fine, here's that whore's info - you better delete my number from your phone and don't message me on Facebook either!
Controller: WTF? Women... I swear, crazy bitches. Alright user, I got your info right here. It's a damn mess though, Models just threw it at me from across the room. Go to the next window down, I'll hand this all off to View and he'll get it put back together so you can read it.
View: Man, this is bullshit... I can not wait to quit this job.

or

Quote:User: Hey, can I look at the information you have about me?
Controller: I hear you - let me go check with my main man Authentication, see if you've identified yourself.
Authentication: Hell's nah that ain't user - I'd know user any day of the motherfuckin' week and you ain't no user.
Controller: WTF "user"? You trying to play games with me son, huh? GTFO!


Messages In This Thread
class method from another class - by El Forum - 11-29-2010, 12:31 PM
class method from another class - by El Forum - 11-29-2010, 12:43 PM
class method from another class - by El Forum - 11-29-2010, 12:53 PM
class method from another class - by El Forum - 11-29-2010, 12:55 PM
class method from another class - by El Forum - 11-29-2010, 01:00 PM
class method from another class - by El Forum - 11-29-2010, 01:13 PM
class method from another class - by El Forum - 11-29-2010, 01:15 PM
class method from another class - by El Forum - 11-29-2010, 01:51 PM
class method from another class - by El Forum - 11-29-2010, 02:21 PM
class method from another class - by El Forum - 11-29-2010, 02:58 PM
class method from another class - by El Forum - 11-30-2010, 07:16 AM



Theme © iAndrew 2016 - Forum software by © MyBB