Laravel5.1分页跳转page变,内容不变.....抑郁中...求解
TestController.php
Test.blade.php
结果输出数据库2条记录,默认分页链接.
点击分页链接,page值变,内容不变.
这是哪里出问题了
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Http\Requests;
use App\Http\Controllers\Controller;
use App\Test;
class TestController extends Controller
{
public function index()
{
$tests = new Test();
$model = $tests::paginate(2);
return view('test', ['models'=>$model]);
}
}
Test.blade.php
@foreach($models as $model)
{{$model->id}}
{{$model->spname}}<br>
@endforeach
{!! $models->render() !!}
结果输出数据库2条记录,默认分页链接.
点击分页链接,page值变,内容不变.
这是哪里出问题了
1 个回复
moz
赞同来自: