Layout Inside Layout


I have created a custom menu-layout called “menu.php” to layouts-directory. This menu-layout will be used in every page. At the moment I’m trying to render this menu-layout inside my default controller layout(which is defined in the controller) in the following way:



   <?php $this->renderPartial('//layouts/menu', array());?>  


However, it’s not rendering it. With this approach I don’t get even error messages. So my actual question is, how to render more views from layouts-directory to the same layout?



Well, thats the way to do it.

You dont need to have the empty array tho, but thats not whats causing the problem.

Can you post more of the code in the layout-file you are trying to render into?


u can set the in main layout in your defultcontroller

public $layout 		= 'main';

then after create the main.php in layout folder

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">

<html xmlns="">


<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title><?php echo SystemConfig::getValue('site_title');?></title>

<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/main.css" />

<!--[if IE]><script src="js/html5.js"></script><![endif]-->



	 <section class="wapper">

             <?php //p( yii::app()->customer)  ?>

	 		<?php echo $this->renderPartial('layouts/header');?>

	 		<?php //echo $this->renderPartial('layouts/slider');?>


	 		<?php echo $content;?>

         	<?php echo $this->renderPartial('layouts/footer');?>





the problem is your path…

i dont know your path pattern but i m using


probably this is the ugliest way but it works:P