Yii Framework Forum

How can we create relation without Primary and Foreign key in yii1


(demon21) #1

I created in model like this–
return array(
‘tbluser’=>array(self::HAS_ONE,‘Tbluser’,’’,‘on’=>‘tbluser.LoginID=farmer.FarmerID’),
)

in view cgridview i’m showing data as
array(
‘name’ => ‘UserName’,
‘header’=>‘Farmer Name’,
‘filter’=>false,
‘type’ => ‘raw’,
‘value’=>’$data->tbluser->UserName’,
),
It throws an error !!
Please help