Can't Show Owner And Requester Name In View.php

Hi everyone, I got stuck in this one case.

I try to show username based on id of the user, so I set relation in issue 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(


		'requester' => array(self::BELONGS_TO, 'Issue', 'requester_id'),


		'owner' => array(self::BELONGS_TO, 'Issue', 'owner_id'),


		'project' => array(self::BELONGS_TO, 'Project', 'project_id')


	);


}

and, I put relation in project 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(


		'issues' => array(self::HAS_MANY, 'Issue', 'project_id'),


		'users' => array(self::MANY_MANY, 'User', 'tbl_project_user_assignment(project_id, user_id)')


	);


        }

But, I try to see the output of the view.php of issue model can’t show the username although I have put (see attachment)

<?php $this->widget(‘zii.widgets.CDetailView’, array(

'data'=&gt;&#036;model,


'attributes'=&gt;array(


	'id',


	'name',


	'description',


	array(


		'name'=&gt;'type_id',


	    'value'=&gt;CHtml::encode(&#036;model-&gt;getTypeText()),


	),


	array(


	    'name'=&gt;'status_id',


	    'value'=&gt;CHtml::encode(&#036;model-&gt;getStatusText()),


	),


	array(


	    'name'=&gt;'owner_id',


	    'value'=&gt;CHtml::encode(&#036;model-&gt;owner-&gt;username), //doesn't show up


	),


	array(


	    'name'=&gt;'requester_id',


	    'value'=&gt;CHtml::encode(&#036;model-&gt;requester-&gt;username), //doesn't show up


	)


),

));

Any idea?

Same with me any idea people thanks.

I think your requester and owner relations in Issue are pointing to the wrong model.





public function relations()

{

	return array(

		'requester' => array(self::BELONGS_TO, 'User', 'requester_id'), // Not Issue

		'owner' => array(self::BELONGS_TO, 'User', 'owner_id'), // Not Issue

		'project' => array(self::BELONGS_TO, 'Project', 'project_id')

	);

}