Anybody can help me out with creating another column with the all the Classe->nome occurrences for each Arma row?
Maybe comma separated since there can be many of them for each Arma. I’m digging through documentation but i can’t make it work. I think this can be a useful how-to even for other newbies like me in the same situation.
I hope i’ve made it clear enough to make sense to you!
I suggest creating a method in your model class to retrieve the related values and present them as a comma separated list as you mentioned.
//Arma.php (Model)
public function getClasses(){
return implode(',', $this->classes);
}
//then in your gridview, something to this effect
'value'=>'$data->getClasses()'
Someone should correct me if I’m wrong about this, but I think I heard this somewhere. If you create a function in the ActiveRecord class such as getSomething(), that you can then treat this as an attribute? Like $model->something instead of $model->getSomething()? Either way, I think using a get method like this should do the trick of collecting all the related fields and allowing you to put that into your gridview.