程式碼如下:
<portal:articles limit="5" order="post.published_time DESC" categoryIds="$category_ids">
<li class="tm-recent-post-list-li">
<a href="{:url('portal/Article/index',array('id'=>$vo.id,'cid'=>$vo.category_id))}"><img
width="150" height="150" src="{:cmf_get_image_url($vo.more.thumbnail)}"
class="attachment-thumbnail size-thumbnail wp-post-image" alt=""></a><a
href="{:url('portal/Article/index',array('id'=>$vo.id,'cid'=>$vo.category_id))}">{$vo.post_title}</a><span
class="post-date"><i class="fa fa-calendar"></i>{:date('Y-m-d',$vo.published_time)}</span>
</li>
</portal:articles>
報錯:
經過反覆檢視文件發現需要引入標籤庫。方法:
<taglib name="app\portal\taglib\Portal"/>
在模板檔案頭部載入上面的標籤庫。把標籤庫放在公共頭部檔案頭部,這樣就不用每個模板檔案寫一次標籤載入程式碼了