<?php
class WebUser extends CWebUser{
protected function afterLogin($fromCookie)
{
$criteria = new CDbCriteria;
$criteria->condition = "email=:email";
$criteria->params = array(":email"=>$this->getName());
$this->setState('userObject',User::model()->find($criteria));
}
}
So whenever i want to get current user info (filled from db), i will do:
$currentUser=Yii:app()->user->getState(‘userObject’);
I think this is not the correct way…
What do you think?
mukeshsoni
(Mukeshsoni)
2
just Yii::app()->user->userObject will do
So i’m doing it in the right place.
Thank you!