tp5 foreach volist for

  {foreach :model('one')->all() as $key=>$v}
  //  {foreach $list as $key=>$v}
    {$v}<br>
    {/foreach}
	{volist name='list' id='v' offset='3' length='5'}
	//  {volist name=':model("one")->all()' id='v'}
	    {$v}<br>
    {/volist}

{volist name=':model("one")->all()' id='v' mod='2'}
        {eq name='mod' value='0'}//取模运算
        {$v}<br>
        {/eq}
{/volist}
 {volist name=':model("one")->where("id",1000)->all()' id='v' empty='没有数据'}
        {$v}<br>
 {/volist}
  {volist name=':model("one")->all()' id='v'   empty='没有数据'}
        {$v.username}{$i}<br>
  {/volist}

{volist name=':model("one")->all()' id='v'  key='k' empty='没有数据'}
       {$v.username}{$k}<br>
 {/volist}

{for start='1' end='100' comprison='<' step='2' name ='i'}
       {$i}<br>
{/for}

你可能感兴趣的:(tp)