简单标签使用demo

解决已知bug
This commit is contained in:
2020-04-22 21:32:36 +08:00
parent 5ae9d68948
commit 676c5854cd
12 changed files with 40 additions and 144 deletions

View File

@@ -23,10 +23,11 @@ class Sent extends \think\template\TagLib {
);
public function tagnav($tag, $content){
$type = isset($tag['type']) ? $tag['type'] : '';
$pid = isset($tag['pid']) ? $tag['pid'] : '';
$tree = isset($tag['tree']) ? $tag['tree'] : 1;
$tree = isset($tag['tree']) ? $tag['tree'] : false;
$parse = '<?php ';
$parse .= '$__NAV__ = \\app\\model\\Channel::getChannelList('.$pid.', '.$tree.');';
$parse .= '$__NAV__ = \\app\\model\\Channel::getChannelList('.$type.', "'.$pid.'", '.$tree.');';
$parse .= 'foreach ($__NAV__ as $key => $'.$tag['name'].') {';
$parse .= '?>';
$parse .= $content;