From f3dec1751a80aeb88a0c48703754ebd73e8cdea6 Mon Sep 17 00:00:00 2001 From: molong Date: Tue, 24 Jul 2018 20:21:07 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E6=A8=A1=E6=9D=BF=E4=B8=AD?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E4=BD=BF=E7=94=A8=E6=A0=87=E7=AD=BE=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/config.php | 8 -------- application/index/config.php | 1 + extend/com/Sent.php | 3 ++- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/application/config.php b/application/config.php index 41d73651..e61d4f26 100644 --- a/application/config.php +++ b/application/config.php @@ -17,14 +17,6 @@ return [ // 应用调试模式 'app_debug' => true, - // +---------------------------------------------------------------------- - // | 模板设置 - // +---------------------------------------------------------------------- - - 'template' => [ - 'taglib_build_in' => 'cx,com\Sent', - ], - // 视图输出字符串内容替换 'view_replace_str' => [ '__PUBLIC__' => '/static', diff --git a/application/index/config.php b/application/index/config.php index a37b1a57..8f67aa2c 100644 --- a/application/index/config.php +++ b/application/index/config.php @@ -1,6 +1,7 @@ array( + 'taglib_build_in' => 'cx,com\Sent', 'view_depr' => '_' ) ); \ No newline at end of file diff --git a/extend/com/Sent.php b/extend/com/Sent.php index d3d65523..9185a391 100644 --- a/extend/com/Sent.php +++ b/extend/com/Sent.php @@ -27,7 +27,7 @@ class Sent extends Taglib{ // 标签定义: attr 属性列表 close 是否闭合(0 或者1 默认1) alias 标签别名 level 嵌套层次 'nav' => array('attr' => 'name,pid', 'close' => 1), //获取导航 'list' => array('attr' => 'table,where,order,limit,id,sql,field,key','level'=>3),//列表 - 'doc' => array('attr' => 'model,field,limit,id,field,key','level'=>3), + 'doc' => array('attr' => 'model,field,limit,id,field,key,name','level'=>3), 'recom' => array('attr' => 'doc_id,id'), 'link' => array('attr' => 'type,limit' , 'close' => 1),//友情链接 'prev' => array('attr' => 'id,cate' , 'close' => 1),//上一篇 @@ -55,6 +55,7 @@ class Sent extends Taglib{ $field = empty($tag['field']) ? '*' : $tag['field']; $limit = empty($tag['limit']) ? 20 : $tag['limit']; $order = empty($tag['order']) ? 'id desc' : $tag['order']; + $name = isset($tag['name']) ? $tag['name'] : 'item'; //获得当前栏目的所有子栏目 $ids = get_category_child($cid);