Yii Framework Forum: Facebook for Yii - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Facebook for Yii How to Facebook-Connect before content is created?? Rate Topic: -----

#1 User is offline   PaulC 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 23-June 10

Posted 23 June 2010 - 04:04 AM

I'm developing a website using Yii and I want the users to log in via Facebook Connect. I've got it working but the problem I found is that in /views/layouts/main.php, the $content is generated *before* main.php is run, so my Facebook Connect script is run after I'm done generating dynamic content.

I have a User model, and I need the user to log-in through Facebook before I can fetch data from my own database for that Facebook user. What I want to achieve is this scenario:

1) User has already logged into Facebook previously and comes to my site.
2) My javascript/cookie detects that the user has already logged into his Facebook account and spits out a UID.
3) Using this UID, I use the User model to query for the UID and get the user data.

How can I do this? Sorry if my explanation of the problem is all over the place, but I'm just really confused.. =(
0

#2 User is offline   mech7 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 220
  • Joined: 26-March 09

Posted 23 June 2010 - 10:24 AM

here is how i did it..

http://www.yiiframew...dpost__p__43783
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users