Laravel 5无法渲染分页

时间:2015-10-15 01:52:19

标签: laravel-5 laravel-pagination

我是Laravel 5的新手,我有一个显示分页的问题。我查看了文档,但无法让它工作。

UserController中:

public function getIndex()
{
    $users = User::where('active', '=','verified')->simplePaginate(10);
    return View::make('User.index')->with('users',$users);
}

index.blade.php:

<table class="table table-bordered table-hover">
                <thead>
                <tr>
                    <th>id</th>
                    <th>username</th>
                    <th>email</th>
                    <th>role</th>
                    <th>created</th>
                    <th class="actions">Actions</th>
                </tr>
                </thead>
                <tbody>
                @foreach($users as $user)
                    <tr>
                        <td>{{ $user->id }}</td>
                        <td>{{ $user->username }}</td>
                        <td>{{ $user->email }}</td>
                        <td>{{ $user->role }}</td>
                        <td>{{ $user->created_at }}</td>
                        <td class="actions">
                            blabla
                        </td>
                    </tr>

                @endforeach
                </tbody>
            </table>
{!! $users->render() !!}

1 个答案:

答案 0 :(得分:0)

由于某种原因,它正在打印额外的/

修正:

{!! str_replace('users/','users',$users->render()) !!}