Partial Render View from Module to main directory

[size="5"]Problem 1[/size]

I want to renderPartial a view from modules. Actual directory structure is protected/modules/staff/views/myplacedeals/create.php is the file that needs to be rendered in protected/views/places/view.php The problem is that i get exception if I put


$this->renderPartial(YiiBase::getPathOfAlias('staff').'/views/myplacedeals/create.php',array())



or


$this->renderPartial(YiiBase::getPathOfAlias('staff').'/views/myplacedeals/create',array())

or


$this->renderPartial('staff/views/myplacedeals/create',array())

or


$this->renderPartial('/staff/views/myplacedeals/create',array())

of


$this->renderPartial('//staff/views/myplacedeals/create',array())

nothing from above works.

I get


CException : PlacesController cannot find the requested view

in CHAT

Rawatz and Ciss helped but i was not able to make it work.

[size="5"]Problem 2[/size]

with this i also have a confusion that when it comes to renderPartial’s first argument it says that works like getViewFile. Now conditions for view file returning is

http://www.yiiframework.com/doc/api/1.1/CController#getViewFile-detail

Question is what ever you give in first parameter getViewFile would search for given view in following order

absolute view within a module if fails next

absolute view within the application if fails next

aliased view if fails next

relative view

?

the reason for module is self-contain and independent, so I would not renderpartial view in another module.

you could use cportlet instead of renderpartial.

check code of function renderpartial , if you replace $view with $viewFile, it shows empty string,

so whatever your syntax was you will all get the same error, it does not say, yii did not find your $view

but resolved $viewFile, so my understanding is yii did not expect you to renderpartial from another modules.

correct me if i’m wrong.




public function renderPartial($view,$data=null,$return=false,$processOutput=false)

{

	if(($viewFile=$this->getViewFile($view))!==false)

	{

		$output=$this->renderFile($viewFile,$data,true);

		if($processOutput)

			$output=$this->processOutput($output);

		if($return)

			return $output;

		else

			echo $output;

	}

	else

		throw new CException(Yii::t('yii','{controller} cannot find the requested view "{view}".',

//				array('{controller}'=>get_class($this), '{view}'=>$view)));

			array('{controller}'=>get_class($this), '{view}'=>$viewFile)));

}



it throws error like this:


ShipmentController cannot find the requested view "". 

Try $this->renderPartial(‘application.modules.staff.views.myplacedeals.create’,array())

cool

Yes, it’s working…