[SOLVED] renderer view of the parent controller

Hello everybody ,

I’ve this organs hierarchy:

OrganController

  • ColonController

  • BreastController

I’ve this view: themes/classic/views/organ/analysis.php

I need to renderer from Colon and Breast controller this analysis. I tried in this way on OrganController:

public function renderAnalysis()

{


//	$this->id = 'Organ'; // error becaus id read-only


	$this->render('analysis', $this->data);


}

colon e breast call this inherited function, but yii doesn’t find the view, because it search colon/analysis.php.

$this->render(’../organ/analysis’, $this->data);

I tried this solution, but it doesn’t work

call


renderPartial('../organ/analysis', $this->data);

from colon’s view

ok, I have to create views/colon/analysis.php with this content:

<?php $this->renderAnalysis(’../organ/analysis’);?>

And on ColonController actionIndex:

   public function actionAnalysis() 


{


	parent::actionAnalysis();


	


	&#036;this-&gt;renderPartial('analysis');


}

It works in this manner, but the best solution would be to call directly from the view controller Colon organ/analysis.php, without having to create the folder views/colon.

thanks

From parent controller:

$this->render(‘webroot.themes.classic.views.organ.analysis’, $data));