我有關於視圖和佈局的紅色指南,我已經用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