renderPartial() within a layout?

Hi,

I am trying to render a view within my layout but I dont get it working.

themes/classic/views/layouts/main.php

[PHP]

<?php echo $content; ?>

<!-- Some code -->

<div>

<?php $this->renderPartial(’_myViewFile’); ?>

</div>

<!-- Some code -->

[/PHP]

I expected that ‘_myViewFile’ is beeing searched within the directory ‘themes/classic/views’ - But the file is beeing searched within the view directory which is determined by the current active controller / module.

I now used $this->renderFile() and used the absolute path to the file - But it seems wrong. What do i miss?

read this http://www.yiiframework.com/doc/guide/1.1/en/topics.theming

You have also the // for the views, to go to the "base" of the views and start building the path from it

also you need to set the theme , for this you can use my theme picker, see in signature

I am through this… I still dont get the solution… The theme is set and working!

My friend, it’s very simple. Use $this->renderPartial(’/layouts/_partial’);

Also :

http://www.yiiframework.com/doc/api/1.1/CController#getViewFile-detail

So, it’s better to use double slashes :




$this->renderPartial('//layouts/_partial');