Yii::app->user->organisations or Yii::app->benefitUses
the following is my relation and it is generated by gii..
this is my relation for User model.
public function relations() { // NOTE: you may need to adjust the relation name and the related // class name for the relations automatically generated below. return array( 'benefitUses' => array(self::HAS_MANY, 'BenefitUse', 'user_id'), 'organisations' => array(self::MANY_MANY, 'Organisation', 'user_organisation(user_id, organisation_id)'), }
when i'm accessing like this
<?php var_dump(Yii::app()->user->benefitUses);die; ?>
from view it is showing error like "Property "CWebUser.benefitUses" is not defined."[/code]
And
when i'm accessing like this
<?php var_dump($this->user->benefitUses);die; ?>
from view it is showing error like "Property "UserController.user" is not defined."[/code]
how to get the user instance here rather than CWebUser or UserController?? and how can i access the joining data all over site with
Yii::app->user->organisations or Yii::app->benefitUses
Any help pls..
Many Thanks,