search

Home  >  Q&A  >  body text

php - Regarding the nesting of TP volist~~ I’m so confused!

array(16) {
["General Check"]=>
array(3) {

[0]=>
string(6) "身高"
[1]=>
string(6) "体重"
[2]=>
string(6) "视力"

}
["Internal Medicine"]=>
array(11) {

[0]=>
string(12) "主要病史"
[1]=>
string(6) "血压"
[2]=>
string(6) "发育"
[3]=>
string(6) "胸廓"
[4]=>
string(6) "肺部"
[5]=>
string(6) "心界"
[6]=>
string(6) "心音"
[7]=>
string(6) "节律"
[8]=>
string(3) "脾"
[9]=>
string(3) "肾"
[10]=>
string(12) "神经系统"

}
["Surgery"]=>
array(6) {

[0]=>
string(12) "主要病史"
[1]=>
string(6) "皮肤"
[2]=>
string(9) "淋巴结"
[3]=>
string(9) "甲状腺"
[4]=>
string(6) "脊柱"
[5]=>
string(6) "四肢"

}

Only part of the above array ($arr) is posted. I want to display the above array in the front end. The front end structure is as follows:

                            <ul>
                                <li>
                                    <ul>
                                        <li></li>
                                    </ul>
                                </li>
                            </ul>
                            
                            

I want to use volist to display in such a structure, the outer layer li displays the key, and the inner layer displays the corresponding value
How to implement it! ~~

迷茫迷茫2759 days ago780

reply all(1)I'll reply

  • 淡淡烟草味

    淡淡烟草味2017-07-04 13:47:57

    tp5?? The volist tags of tp5 and tp3 are different

    {volist name="arr" id="medical"}
    <ul>
        <li>
            <span>{$key}</span>
            <ul>
                {volist name="medical" id="project"}
                <li>{$project}</li>
                {/volist}
            </ul>
        </li>
    </ul>
    {/volist}

    reply
    1
  • Cancelreply