i have a situation that i could not find a solution.
i have two models User & Profile
they have a relation in User model like this:
'profile' => array(self::HAS_ONE, 'Profile', 'id'),
what im trying to do is:
after login -if user profile is empty- im redirecting users to a setup page which has both attribs from User & Profile models.
after login im running this action:
public function actionMain()
{
$user = User::model()->with('profile')->findByPk(Yii::app()->user->id);
if ($user->profile)
$this->render('main', array('user'=>$user));
else
$this->render('profile', array('user'=>$user, 'update'=>false));
}but since this is being called from User controller im having errors in the view for Profile model`s attribs.
how can i update both models in a single view?

Help











