Is it possible to render a layout file independently?

I need to render the standard /layout/column2.php file and return it as part of an ajax request. I don’t want to render the whole page just to generate it. Is this possible? I can pass in the required data.

You can create a widget with what you need of latout/column2, render the widget in layout/column2 and render in your controller where you have to render.

If you need only the operation menu, this is already a widget named CMenu, yu can simply render this widget.

Thanks zaccaria. Exactly what I needed

I’m having trouble getting the title of the sidebar to render.

my code:




$this->beginClip('widget');

$menu_widget = $this->widget('zii.widgets.CPortlet', array(

	'title'=>'Operations',

));

$menu_widget->widget('zii.widgets.CMenu', array(

	'items'=>$this->menu,

	'htmlOptions'=>array('class'=>'operations'),

));

$this->endClip();

$sidebar = $this->clips['widget'];



$sidebar now contains the menu, except for the title (and its css). How to I get the clip to render the title as well.