这是我的anything.blade.php代码:
@foreach ($data2 as $value2)
<p class="card-text" id="des6"> {{$value2->description}}</p>
@endforeach
以下是我如何从控制器传递数据
public function getHalls(Request $request)
{
$data['data'] =\DB::table('advertisements')
->select(\DB::raw("*"))
->orderBy('idadd')->paginate(12);
try{
$data2['data2'] =\DB::table('hotel')
->select(\DB::raw("*"))
->where('idhotel', '=', '1')
->get();
}catch (QueryException $exception){
return $exception->getMessage();
// abort(404, 'The requested resource could not be found.');
}
if(count($data['data'])>0)
{
return view('hotelpage', $data,$data2);
}
else
{
return "no data";
}
}
}
以下是我获取输出的方法
但我想在下面显示它
fdfd dsfdfdf fbfbfbf fvbhf
我怎样才能做到这一点?
答案 0 :(得分:1)
试试这个
@foreach ($data2 as $value2)
<p class="card-text" id="des6">
{!! $value2->description !!}
</p>
@endforeach