Yii Framework Forum: User Id Ve Diğer User Verileri Set Ve Get Etme - Yii Framework Forum

Jump to content

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

User Id Ve Diğer User Verileri Set Ve Get Etme

#1 User is offline   selo 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 52
  • Joined: 08-November 13

Posted 08 January 2014 - 10:43 AM

Quote

$user=User::model()->findByAttributes(array("username" => Yii::app()->user->name ));
Yii::app()->setParams(array("user" => $user));
$id = ($user) ? $user->id : 0;


bunu layouts da main.php ye koyuyorum lakin her istediğim yerden cagıramıyorum.ama mantıken calışmalı.devamlı boş donuyor.

nasıl set etmek lazım ve nerede?
0

#2 User is offline   McQueen 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 138
  • Joined: 13-August 11
  • Location:Istanbul/Turkey

Posted 08 January 2014 - 11:26 AM

View Postselo, on 08 January 2014 - 10:43 AM, said:

bunu layouts da main.php ye koyuyorum lakin her istediğim yerden cagıramıyorum.ama mantıken calışmalı.devamlı boş donuyor.

nasıl set etmek lazım ve nerede?


bir fonksiyon içine al...
değişkeni public yap..
$this->değişken le çağır
0

#3 User is offline   selo 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 52
  • Joined: 08-November 13

Posted 08 January 2014 - 02:41 PM

çözüm
http://www.yiiframew...tic-parameters/
0

#4 User is offline   McQueen 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 138
  • Joined: 13-August 11
  • Location:Istanbul/Turkey

Posted 09 January 2014 - 01:42 AM

View Postselo, on 08 January 2014 - 02:41 PM, said:



faydalı bir bilgi. teşekkürler... konuyla ilgili yeni bir topic açıp linki eklersen forumda pinleyelim...
0

#5 User is offline   selo 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 52
  • Joined: 08-November 13

Posted 09 January 2014 - 09:16 AM

bu çözümde fena değil.

http://www.yiiframew...ending-cwebuser
0

#6 User is offline   selo 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 52
  • Joined: 08-November 13

Posted 09 January 2014 - 10:37 AM

kısa ve sadece id için

http://www.yiiframew...to-yii-app-user
0

#7 User is offline   McQueen 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 138
  • Joined: 13-August 11
  • Location:Istanbul/Turkey

Posted 09 January 2014 - 12:23 PM

İnsanların daha ilgili bir arama ile bulabilecekleri bir başlıkla (direk konuyla alakalı) konuyu tekrar açabilirmisin?
0

#8 User is offline   selo 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 52
  • Joined: 08-November 13

Posted 09 January 2014 - 03:16 PM

ok.
0

#9 User is offline   McQueen 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 138
  • Joined: 13-August 11
  • Location:Istanbul/Turkey

Posted 09 January 2014 - 03:34 PM

Teşekkürler,

Topic yeniden adlandırıldı....
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