Today in the thinkphp 3.2.2 try to use multiple loops in the template, to the corresponding categories under the corresponding articles are sequentially loop out, but in any case can only loop out the category, the category of the article can not be recycled, ( error ) code as follows:
<volistname= "List"ID= "Vo"> <TRclass= ' {$vo. help_category_id} '> <TD>{$vo. help_category_id}</TD> <TDclass= ' Display_name '>{$vo. Display_name}</TD> <TD></TD> <TD></TD> <TD> <spanclass= ' Addtopic '> <ahref= ' # 'onclick= "return false">What's new</a> </span> <spanclass= ' cate_enabledstate{$vo. is_enabled} '> <ahref= ' # 'onclick= "return false"><ifcondition= "$vo [' is_enabled '] eq 1">Time out<Else/>Enable</if></a> </span> <spanclass= ' '> <ahref= ' # '>Delete</a> </span> </TD> </TR> <!--Looping Articles - <volistname= "Topic_list"ID= "Topic_vo"> <if condition= "$topic _vo.help_category_id eq $vo. help_category_id" > <TR> <TD>{$topic _vo.topic_id}</TD> <TD></TD> <TD>{$topic _vo.title}</TD> <TD>{$topic _vo.priority}</TD> <TD><span>Edit</span> <span>Time out</span> <span>Delete</span></TD> </TR> </if> </volist> </volist>
The code for the Red magnified font is the error code. To properly remove the data, you should change the code to red:
<if condition= "$topic _vo[' help_category_id '] eq $vo [' help_category_id ']" >
Report:
"ThinkPHP3.2.2 fully developed manual CHM 2014-04-14":
Since the condition attribute of the IF tag is basically PHP syntax , it is more concise to use the judgment tag and the switch tag as much as possible, in principle, it can be solved with switch and comparison label as far as possible without using the IF tag. Because switch and comparison tags can use variable adjusters and system variables. If the IF tag still does not meet the requirements under certain special requirements, you can write the code directly using native PHP code or PHP tags.
thinkphp 3.2.2 Use if to determine tags in volist multi-loop nesting