beesho
(Bg 11)
February 25, 2013, 1:17pm
1
Hello,
Am trying to render a view from another model view, however am getting the grid layout of that view but without any data. (it retrieves the labels of that model but with all data ‘Not Set’)
For more details, I have company & branch models and i want to render in the company view the branch view of the related branch.
my code is:
$branchModel = Branch::model();
$this->renderPartial('//Branch/view', array('model'=>$branchModel, 'id'=>4));
Please advise on how to solve that, and if there is a better way of doing it.
Thank you!
jacmoe
(Jacob Moen)
February 25, 2013, 2:22pm
2
[color="#006400 "]/* moved from Misc */[/color]
Gerendai
(Gerendaib)
February 25, 2013, 2:51pm
3
beesho:
Hello,
Am trying to render a view from another model view, however am getting the grid layout of that view but without any data. (it retrieves the labels of that model but with all data ‘Not Set’)
For more details, I have company & branch models and i want to render in the company view the branch view of the related branch.
my code is:
$branchModel = Branch::model();
$this->renderPartial('//Branch/view', array('model'=>$branchModel, 'id'=>4));
Please advise on how to solve that, and if there is a better way of doing it.
Thank you!
Try:
$branchModel = Branch::model()->findAll();
$this->renderPartial('/Branch/view', array('model'=>$branchModel, 'id'=>4));
But I think the model should be defined in the Contoller not in the view.
Can you post your view file? where you use a dataProvider?