来自控制器:
$response = (new ApiController)->checkNumbers();
if(!empty($response['status']) && ($response['status'] == 'SUCCESS')) {
$numbers = json_encode($response['numbers']);
}
return [
'html' => view('show.numbers', compact(
'numbers'
))->render()
];
如何在刀片文件中显示“数字”以反映表中的 UI? 任何帮助将不胜感激。
非常感谢
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
以下示例介绍了如何从控制器传递数据并将其填充到刀片。
例如,我有一个表:'user',其中包含 id、名字和姓氏列:
SampleController.php
public function FetchUser(){ $data = User::all(); return view('MyView')->with([ 'data' => $data ]); }MyView.blade.php
{{-- populate it in a table --}}