我有关于视图和布局的红色指南,我已经用Google搜索了如何做到这一点,但我仍然无法使其工作。这是问题:如何创建使用页眉和页脚部分的布局
我想有2column.php和3column.php布局,其中都使用_header.php和_footer.php部分。
2columns.php布局实例:
render _header.php
$content and some other extra code
render _footer.php
无论我做什么,我不能使它发挥作用。有人可以发布我真正简单的例子,如何实现这一目标?由于
请注意这个问题的答案:
使用:
<?php $this->beginContent('@app/views/layouts/header.php'); ?>
<!-- You may need to put some content here -->
<?php $this->endContent(); ?>
不帮我......不知道怎么用它做什么,我不能让它做什么,我需要。
您是否尝试过使用PHP'包括“file.php''包括页眉和页脚文件? – jakecfc1992
我希望有一些Yii2的方式。 – offline