40 min. thinkphp Loop nesting prints out a list of parent and child classes
Hello everybody, I am learning thinkphp frame In recent time, I want to make a data list in the template page, the format is: first the parent category name, then print out the corresponding subclass list, then print another parent class name, then print the corresponding subclass of the parent class, and so on ... I am using form layout, format such as:
Introduction to Category names
Parent class Name 1......
Subclass Name 1 .....
Subclass Name 2 .....
Subclass Name 3 .....
Parent class Name 2......
Subclass Name 1 .....
Subclass Name 2 .....
Subclass Name 3 .....
Ask how to achieve with volist, or there is no better way, please advise, grateful!!
------Solution--------------------
The return of the land is used to traverse it.
------Solution--------------------
You can try it: for the first time, I'll find all the parent_id. Then write down the total amount of the Recordset Parent_count, and then loop parent_count down, and so on ...
------Solution--------------------
{$vo. depa_id}
!--? php if ($vo [' depa_default '] = = 1)
echo '
[Main Page] ';? >{$vo. Depa_title
{$vo. Label_count}
{$vo. model_name}
{$vo. de
Pa_order}
{$son. depa_id}
------Solution--------------------
-"title = "
------solution--------------------
-"/>{$son. Depa_title}
{$son. label_count
{$son. model_name}