... are possible in Yii?
Thanks :-)
Page 1 of 1
Nested layouts...
#2
Posted 10 October 2008 - 04:45 PM
Yes. Assume you have a view which uses layout A that is nested in another layout B. When rendering the view, you should set its layout to be A. Inside A, you use the following:
In layout B, you just need to echo $content to display content of layout A.
<?php $this->beginContent('/path/to/layoutB'); ?>
stuff for layout A
<?php echo $content; ?> this is from the view
stuff for layout A
<?php $this->endContent(); ?>
In layout B, you just need to echo $content to display content of layout A.
#3
Posted 15 October 2008 - 12:54 PM
I tried this and was not able to get it to work
no matter what I place between "beginContent" & "endContent" it always only shows the "testview".
Thoughts ?
NZ
<?php $this->beginContent('/testview',array()) ; ?>
Start <?php echo "aa".$content; ?> End
<?php $this->endContent(); ?>
no matter what I place between "beginContent" & "endContent" it always only shows the "testview".
Thoughts ?
NZ
#4
Posted 15 October 2008 - 12:59 PM
Sorry got the view layer mixed up, the "testview" need the "echo $content" not the parent
Share this topic:
Page 1 of 1

Help
This topic is locked












