For all ajax request i just want to load the content inside “right” but for all others it’s the whole thing. The left content is same in most cases but changes in a few cases. So Is there a way i can override a block in the layout without using a variable to hold html something using BeginContent.
To make myself clear
[list=1]
[*]For ajax requests i only render the view with ajax layout
[*]For non ajax requests i render main template with view
[*]For a few non ajax requests i render main template with view but i want a few changes in the main template content.
[/list]
PS: I am aware of "renderPartial" and request->isAjaxRequest. My concern is the conetnt part
You can set up multiple layouts in Yii … by default in the protected/views/layouts/ folder you will find column1.php and column2.php. In your controller you can change the layout that is being used as follows:
public $layout='//layouts/layoutxxx';
where layoutxxx is a layout you created
So, if you want to have 2 columns for example and have the right column load via ajax you could try something as follows (in layoutxxx.php):