I have next tables: Questionnaire(main), Names, Address, Telephone. Relation HAS_MANY (yes, i need different names).
I'm trying to build in Questionnaire ActionView - > CGridView with data from Names.
In Names table i have:
So i need CGridView which goes in "Questionnaire view" show all data from Names where id_questionnaire=$this->id.
But all that i could do by now, that is Names.name column show all in 1 row: AlexCorbenTest with $data->namesToString();
public function namesToString()
{
$roles = $this->names;
if($roles) {
$string = '';
foreach($roles as $role) {
$string .= $role->name . ', ';
}
return substr($string,0,strlen($string)-1); // substr to remove trailing comma
}
return null;
}
$model->names->name show empty table with 1 row :(
My search() and $this->widget http://paste.ubuntu.com/6838820/