1
現在、私のlaravelプロジェクトをコーディングしています.2つの異なるページ設定で私のビューに 問題があります。最初のページングでは、 次のページ)、2番目のページ番号は の行のレンダリングで異なる変数を持っていても影響を受けます。なぜそれが なのか分かりますか?1つのビューで2つのページネーションをレンダリングする方法
私のコントローラ
public function viewlist($ship_id){
$members = Member::where('ship_id','=',$ship_id)->paginate(3);
$member = Member::where('ship_id','=',$ship_id)->get();
$member_ids = [];
foreach ($member as $mem) {
array_push($member_ids, $mem->scholar_id);
}
$pendings = AddRequest::where('ship_id','=',$ship_id)->paginate(3);
$pending = AddRequest::where('ship_id','=',$ship_id)->get();
$pending_ids = [];
foreach ($pending as $pend) {
array_push($pending_ids, $pend->scholar_id);
}
$recommends = Recommend::where('ship_id', '=',$ship_id)->get();
return view('pages.Organization.List-Of-Organization-Scholar',compact('ship','schol','pendings','members','count_member','recommends'))
;}
マイビュー
@foreach($members as $member)
<div class="col-lg-4">
<div class="col-lg-12 well">
<a class="thumbnail" href="#">
<img class="img-responsive" src="../{!! $member->Memscholar->scholar_image !!}" alt="" height="150" width="200">
</a>
</div>
</div>
@endforeach
<div class = "col-md-12">
{!! $members->render() !!}
</div>
@foreach($pendings as $pending)
<div class="col-lg-4">
<div class="col-lg-12 well">
<a class="thumbnail" href="#">
<img class="img-responsive" src="../../{!! $pending->Pendscholar->scholar_image !!}" alt="" height="150" width="200">
</a>
</div>
</div>
@endforeach
<div class = "col-md-12">
{!! $pendings->render() !!}
</div>
T彼は私が "Class 'Paginator' not found"を持っているエラーです。なぜそれはページネータークラスを探しているのですか? – Gatzmar
Illuminate \ Pagination \ Paginatorを使用する APIの詳細については、https://laravel.com/api/5.4/Illuminate/Pagination/Paginator.html –
をご覧ください。しかし、imはlaravel 5.0を使用していますラーベールではありません5.4 – Gatzmar