Yii Framework Forum: Rendering Belongs To Relation Array - Yii Framework Forum

Jump to content

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

Rendering Belongs To Relation Array Rate Topic: -----

#1 User is offline   Big O 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 31
  • Joined: 07-October 10

Posted 05 November 2010 - 12:35 PM

Hi,

I have 2 models A and B, with 1:N relation between them.
i am running a small view code in AController


public function actionView($id)
{

$mymodel = $this->loadModel($id);
$populatedB = $mymodel->bs;

$this->render('view',array(
'model'=>$mymodel,
'AllBsOfA'=>$populatedB,
));
}

now on the A's view's front i want to display it along with A's view, what is the best way to do that if i want to show only selected fields of B...?


-Big o
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