Get Module's View Within Application View


I have a Yii application with default controller AbcdController.php and it has a view abcd/dashboard.php. This view page is a dashboard which should show the output of four modules in my Yii application. I wish to get output from module’s controller action as

return $html = $this->renderInternal('index', array('data' => 'hi all'), true);

This code is in my module’s controller action.

But here problem is that I can’t access my module’s controller action from AbcdController. How can I call module’s controller action to get above $html? Is there any method to call module’s controller action?

Is renderInternal() a new option in Yii2? Never heard of it in Yii1.1.

Anyway: An idea would be to make a public variable that could be used to get the $html info. Actucally I might do:

class SomeController {

   private $_html = null;


   function getHtml() {

      if is_null($_html) {

         $_html = $this->renderPartial('index', array('data' => 'hi all'), true);


      return $_html;




For renderInternal()

I wish to get above code to be in my module and how can I call this function getHtml() form my core application controller?


$x = application.moduleId.controllerId.getHtml();

Thanks… But its not working…

Create object of module’s controller in core application controller as

list($controller_obj) = Yii::app()->createController('module_controller_id');

$controller_obj -> init();

Now we can access our module controller using above object.

In module controller we should write functions to return view.

return $this->renderPartial('index', array('data' => 'hi all'), true);