OneThink-nav标签
程序员文章站
2022-04-15 09:59:02
...
/* 导航列表 */ public function _nav($tag, $content){ trace($tag); trace($content); trace("end"); $field = empty($tag['field']) ? 'true' : $tag['field']; $tree = empty($tag['tree'])? false : true; $parse = $parse = 'field('.$field.')->where("status=1")->order("sort")->select();'; if($tree){ $parse .= '$__NAV__ = list_to_tree($__NAV__, "id", "pid", "_");'; } $parse .= '?>'; $parse .= $content; $parse .= ' '; // trace($parse); return $parse; }
使用自定义标签