Hello, all I’m trying to do is display a view from one or more models (B,C,D) in another view (A). So I’m on Page A, and I want to display the index pages of B, C, and D. How would I do this? I tried something like the following on the view.php page for A:
but I get “The ‘dataProvider’ property cannot be empty.” So then I tried adding dataProvider:
Don’t do it that way, use path aliases (this will render index.php view of B model)
Now, do you need to set a variable in there or a model?
// assuming you have a $model variable in the view and
// $model is a working model
Do you wish to display that on another view?
$content = $this->renderPartial('app.views.C.index', array('variablename'=>$whatever),true);
// I am going to display $content into another view
*** I totally agree with Zac’s comment, I highly recommend you that you do not use the view of another model, create another view (I have one in protected/views/global/messages.php that I use to display custom ajax Error messages: $this->renderPartial(‘app.views.global.messages’,array(‘type’=>‘error’,‘message’=>‘My error’));