yii2 renderPartial

在 views/news/_copyright.php 中插入如下代碼:php

<div>
    This is text about copyright data for news items
</div>

而後在同級目錄中的itemsList.php中輸入this

<?php echo $this->context->renderPartial('_copyright'); ?>

這樣,就能在itemsList.php中引入_copyright.php的內容了。spa

相關文章
相關標籤/搜索