Yii Framework Forum: Render View File From Another Model View - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Render View File From Another Model View Rate Topic: -----

#1 User is offline   Chris Backhouse 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 34
  • Joined: 04-August 11
  • Location:France

Posted 31 March 2013 - 08:44 AM

Hi

I've encountered a bizarre problem referencing views from another model where in one version of the App it works fine and then in another it doesn't.

The code is very basic, in the "view" view of modelA, I have included:

    $this->renderPartial('/modelB/index',array('dataProvider'=>$modelBs));



The modelB/index then has a ListView as follows:-

$this->widget('zii.widgets.CListView', array(
	'dataProvider'=>$dataProvider,
	'itemView'=>'/modelB/_view'
));


I don't get an error, just blank/nothing/nada.

Then, if I change the view reference to 'application.views.modelB.index' it works OK.

It seems as though the renderPartial is failing, but it doesn't return an error. And yes, there is data in the $modelBs variable.

However, in another version of the App from a few weeks ago it works just fine and I can't see any major differences!
0

#2 User is offline   Chris Backhouse 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 34
  • Joined: 04-August 11
  • Location:France

Posted 31 March 2013 - 09:48 AM

... it was a stupid error in the theme!
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users