Join Table

hello guys… I need to know how to get data within one to many relationsip using yii.

for ex when we have the table client and policy(one to many)how do I get the data in client table using this relationship.thank you.pls help me.If you know good tutorials for that pls give me thoose urls.thank you

[color="#006400"]/* moved from Extensions forum */[/color]

Thanks.I already studiedit.Can you tell me any other tutorials??

hello pls give me one tutorials for the above topic with deceleration with the behavior of model view and controller in yii. pls give me sample coding related to that question.thanks lot…it is great help to me

For example, a post have many comments:

in the post model:

function relation(){


    	'comments' =>array(self::HAS_MANY, 'Comment', 'post_id'),



in the view:

foreach($data->comments as $val){

   echo $val->title;


Thanks lot :)