render()方法居然原样输出了,怎么破?
class StudentController extends Controller { public function index() { $students=Student::paginate(5); return view('student.index',[ 'students'=>$students, 'page'=> $students->render() ]); } }
以下 是模板文件代码:
@section('content') @foreach($students as $stu) {{$stu->name}}<br/> @endforeach <div class="pull-right"> {{$page}} </div> @stop
这里是头部 name1 name2 name3 name4 name5 <ul class="pagination"><li class="disabled"><span>«</span></li> <li class="active"><span>1</span></li><li><a href="http://laravelblog.cn/student/index/?page=2">2</a></li><li><a href="http://laravelblog.cn/student/index/?page=3">3</a></li><li><a href="http://laravelblog.cn/student/index/?page=4">4</a></li><li><a href="http://laravelblog.cn/student/index/?page=5">5</a></li> <li><a href="http://laravelblog.cn/student/index/?page=2" rel="next">»</a></li></ul> 这里是底部
居然显示html源码了,怎么搞的,求大神搭救!