Building CGridView

I have the following tables in my database:





tick.idTema is a foreign key to tema.idTema

The code

$dataProvider=new CActiveDataProvider('Tick');

$this->widget('zii.widgets.grid.CGridView', array(










How can i show nomeTema in the grid ???

thxs !!!

Declare a relation in the Tick model e.g call it rtema. Then use rtema.nomeTema in the grid.

More info on relation here


I think you will have to get the dataProvider sorted out in the controller… i.e joining the tables…