- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试从我的表中获取数据并将其显示在我的 View 中并对这些数据进行分页。我收到了这个问题,但找不到任何解决方案。我在之前的项目中做了完全相同的事情,而且效果很好。
这是我的 Controller
public function hadiBirlikteCalisalimShow (){
$users =DB::table('birlikte_calisalim')->paginate(15);
return view('admin.birliktecalisalim',compact(['users']));
}
<table class="table table-bordered table-hover table-striped">
<thead>
<tr>
<th>İsim</th>
<th>Email</th>
<th>Tarih</th>
<th>İstek</th>
</tr>
</thead>
<tbody>
@foreach($users as $row)
<tr>
<td>{{$users->name}}</td>
<td>{{$users->email}}</td>
<td>{{$users->tarih}}</td>
<td>{{$users->message}}</td>
</tr>
@endforeach
</tbody>
</table>
{{$users->links()}}
最佳答案
@foreach($users as $row)
<tr>
<td>{{$row->name}}</td>
<td>{{$row->email}}</td>
<td>{{$row->tarih}}</td>
<td>{{$row->message}}</td>
</tr>
@endforeach
$row->name,$row->email
等...不是
$users->name
,并更改
{{$users->links()}}
至
{!! $users->render() !!}
关于php - 未定义的属性:Illuminate\Pagination\LengthAwarePaginator::$name,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38475845/
我正在尝试在 Laravel 中手动创建分页,但它返回我模型中的所有项目而不是我设置的“perPage”值,下面是我的代码: $a = mazee\ad::all(); $p = new \Ill
所以我在 laravel 5.4 中使用了自定义分页 Illuminate\Pagination\LengthAwarePaginator; \Illuminate\Pagination\Pagina
我正在尝试从我的表中获取数据并将其显示在我的 View 中并对这些数据进行分页。我收到了这个问题,但找不到任何解决方案。我在之前的项目中做了完全相同的事情,而且效果很好。 这是我的 Controlle
我正在从 LengthAwarePaginator 返回 JSON,但 JSON 的 data 属性不是数组。我需要它是一个数组。有什么想法吗? // grab query parameters $p
谁能帮我完成这个?我是初学者,这是我第一次使用 Laravel 和 PHP。 {{ ++$i }} {{ $value->no_peminjaman }}
我有一个带有 per_page 输入字段的评论列表,允许用户通过 ajax 在页面上显示更多评论。默认情况下,它设置为 50 但是当我尝试更改它时,例如更改为 25,我在开发人员控制台中收到此错误 P
我是一名优秀的程序员,十分优秀!