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:
<volist name= "list" id= "Vo" > <tr class= ' {$vo. help_category_id} ' > <td>{$vo .help_category_id}</td> <td class= ' display_name ' >{$vo. Displa Y_name}</td> <td></td> <td></td> <td> <span class= ' addtopic ' > <a href= ' # ' onclick= ' return false ' > What's new </a> </span> <span class= ' cate_enabled state{$vo. is_enabled} ' > <a href= ' # ' Onc Lick= "return false" ><if condition= "$vo [' is_enabled '] eq 1" > Pause <else/> Enable </if></a> </span> <span class= ' > <a href=' # ' > Delete </a> </span> </td> </tr > <!--loop Article--<volist name= "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& gt;</td> <td>{$topic _vo.title}</td> <td >{$topic _vo.priority}</td> <td><span> edit </span> <span> pause < ;/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