I have a basic layout (main.php) that holds everything and echo's $content. Depending on the action I may want to implement another layout into the $content section. Let's say something like this:
<div class="withSideMenu">
<div class="left">
... here should go the contents of $content
</div>
<div class="right">
<?php $this->widget('SideMenu'); ?>
</div>
</div>
I tried with beginContent() but had no success. Anyone can help?
Whenever you need to use a different sublayout, you then just set it in your action ($this->sublayout = 'sublayout2'). All your sublayouts would be in the layouts folder.