小编tar*_*nik的帖子

以最短的方式检查 Laravel Blade 中是否有任何请求输入

我想检查我的 URL 中的数据是否有任何参数?我以前用过这个条件

@if(app('request')->input('type') || app('request')->input('type-2') || app('request')->input('type-3') || ... many more....)
   <-- code here --> 
@endif
Run Code Online (Sandbox Code Playgroud)

现在它的参数太多了。有没有最短的方法来检查是否有任何参数?喜欢app('request')->has('input')这种最短路线吗?请帮忙注意:laravel 版本 6.19

laravel laravel-blade

0
推荐指数
1
解决办法
1273
查看次数

标签 统计

laravel ×1

laravel-blade ×1