Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/239.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何在Laravel 5.2中增加语义UI表的计数_Javascript_Php_Twitter Bootstrap 3_Laravel 5.2 - Fatal编程技术网

Javascript 如何在Laravel 5.2中增加语义UI表的计数

Javascript 如何在Laravel 5.2中增加语义UI表的计数,javascript,php,twitter-bootstrap-3,laravel-5.2,Javascript,Php,Twitter Bootstrap 3,Laravel 5.2,这可能是一个不着边际的问题,但我在网上没有找到任何关于如何做到这一点的信息 我有一张表格,上面显示了最高点的引导板。 这就是它的样子: 我需要得到每一行有用户名的计数,因此如果该表中有23条记录,那么我需要在#所在的左侧显示1-23条记录 我试着用这个: ($i=0;$iusername} {{$point->points} @endforeach 但是我不断地在一行中得到一个从1到10的循环初始化一个计数器变量$I,并在循环结束时递增它,如下所示: <table class="ui

这可能是一个不着边际的问题,但我在网上没有找到任何关于如何做到这一点的信息

我有一张表格,上面显示了最高点的引导板。 这就是它的样子:

我需要得到每一行有用户名的计数,因此如果该表中有23条记录,那么我需要在#所在的左侧显示1-23条记录

我试着用这个:

($i=0;$i<10;$i++)的
@for
{{$i}
@结束
在我的表格中:


排行榜
#
用户名
要点
@foreach($points作为$point)
#
{{$point->username}
{{$point->points}
@endforeach

但是我不断地在一行中得到一个从1到10的循环

初始化一个计数器变量$I,并在循环结束时递增它,如下所示:

<table class="ui celled striped selectable inverted table">
                <thead>
                    <tr>
                        <th colspan="3" class="center aligned">
                            Leaderboards
                        </th>
                    </tr>
                    <tr>
                        <th>#</th>
                        <th class="center aligned">Username</th>
                        <th class="center aligned"><i class="fa fa-diamond"></i> Points</th>
                    </tr>
                </thead>
                <tbody>
                <?php $i = 0; ?>
                @foreach ($points as $point)
                    <tr>
                        <td>
                           # {{ $i }}
                        </td>
                        <td class="center aligned"> {{ $point->username }}</td>
                        <td class="center aligned"><i class="fa fa-diamond"></i> {{ $point->points }}</td>
                    </tr>
                <?php $i++; ?>
                @endforeach
                </tbody>
            </table>

排行榜
#
用户名
要点
@foreach($points作为$point)
#{{$i}
{{$point->username}
{{$point->points}
@endforeach