📜  laravel 迭代升序 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:53:47.651000             🧑  作者: Mango

代码示例1
@foreach($listdata as $data)
      // iteration ascending (1,2,3,...)
        {{ $data->firstItem() + $loop->index }}

    // iteration descending (...,3,2,1)
        {{ ($data->total()-$loop->index) - (($data->currentpage()-1) * $data->perpage()) }}
@endforeach