You have a controller inside a module - defaultController, in which there is this action - actionIndex, this action renders the view which resides in views/default/index.php, thus the folder structure looks like :
modules - module1 - controllers - defaultController.php - views - default - index.php
now in the index.php view, I want to include a partial from another module - module2, let's call the view "anotherView.php", how do I include it?
I've tried to put the following code in index.php
<?php $this->renderPartial('anotherView', array('params'=>...)) ?>
But that seemed not working since Yii seems to be looking for anotherView in module1/views/default/anotherView.php
One solution seems to be using the widget, that is, to be specific, to move module2/views/.../anotherView.php into application/components/views/anotherView.php and then declare a widget in application/components/AnotherView.php and then use it in index.php as :
<?php $this->widget('AnotherView', array('params'=>...)); ?>
My question is how do I directly fetch any arbitrary view from any views folder and render it in my current view without using a widget or portlet?