dataprovider and model

Hello guys,

I have created with gii 2model and 2crud, called test1 and test2.

If I wanted that the dataProvider test1 was referring to test2, how should I do?

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

‘id’ => ‘test-grid’,

‘dataProvider’ => $model-> search (),

‘filter’ => $ model,

$model refers to test1 … I want to refer to test2!


In your actionAdmin in test1Controller change like below

$model=new test2('search');

There are 2 gridview and i want to connect gridview1 to Model1 and gridview to Model2.

I have added $ Model2 = new Test2 (‘search’) but it gives error.

Undefined variable: Model2

I solved!

i put $Model2 = new Test (‘search’); in view/admin.php!