Global Partial View


I’ve been battling in order to share a partial view across multiple controllers.

Does anyone know what’s the best way to do this?

I’ve tried specifying the whole path in the renderPartial method with no success and the possible solution I’ve come to is to make Widgets for those views. I think using widgets is a bit overkill…

Searching here and Google didn’t lead me to nothing related to what I want.

Thanks in advance.

Path in the following format must work fine:


Thanks. Probably messed up while trying that at first. All good now.

I was looking for the same stuff.

So I put _topmenu.php partial in the /protected/views/layouts/_topmenu.php

and in the layout I wrote <?php echo $this->renderPartial(‘application.views.layouts._topmenu’); ?>.

That made my partial to work globally.

Nice. Thanks.

If you want to include a part of the layout, this is a good method.

If you want to share a view among controllers (like some partial form) is better to create a widget.

using widgets works well, thx

but isn’t there a way to use renderPartial in a global way


I’m still curious to get the code above working in a global way , cross controller and modules

but I didn’t get it to work

can any one see what I might be doing wrong ?


Try this?


// or


Thanks Andy strangely this time around it worked,

I probably misstyped something