lundi 30 mai 2016

Using serial number iwith paginate

I am trying to retreive serial number in the blade template with variable i.

    <?php $i=0;?>
    @foreach ($lists as $li)
    <tr><td><?php $i++;?></td><td></td><td>
    </td><td></td>
    @endforeach
    {!! $lists->render() !!}

but i am using paginate in controller:

$lists=telephone::orderBy('name')->simplePaginate(10);

so, until the first page the serial number is ok. but for the second page. i starts from 1 again.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire