26
2019.2
flow标签详解(递归)
作者: POPASP
flow块标签
前面讲过的所有标签,flow标签是执行顺序最早的一个。赋值单行标签要早于if、select、loopTYPE(TYPE为db、arr、file、field)这些常用的块标签,而晚于flow块标签。flow标签除了作为一个块标签进行局部缓存外,还可以利用它来改变执行顺序、无限极分类的递归显示。
### 改变执行顺序
在标签执行顺序一节的尾部留了下案例,我们可以使用flow来达到我们的目的。
```brush:html
1:{:$temp1=0}
2:{:$temp2=$temp1>0?1:0}
3:{:$temp3=$temp2}
```
这儿的顺序是按1>3>2来执行的,我们可以使用flow块标签来达到1>2>3执行顺序的目的
```brush:html
[:$temp1=0]
[:$temp2=$temp1>0?1:0]
[:$temp3=$temp2]
```
### 无限极分类递归显示
举例
```brush:html
[:$rs = B_("Sort").getRS("select *,(select count(*) from __LJ__prefix__RJ__Sort where ParentID=t.SortID) as c from __LJ__prefix__RJ__Sort t where LanguageID=" & session("languageID") & " and ParentID="& $ParentID & " and sortstatus=1 order by Sortorder ")]
[[[@SortName]]]
+
-
{digui|ParentID="[[[@SortID]]]"}