{{ a or b}} 的問題
已知
? {{ isset($name)? $name: 'default' }}
可以簡寫為
? {{ $name or 'default'}}
??
那么
? {{old('student')['name'] ? old('student')['name']: $student->name}}
可否簡寫為
? {{old('student')['name'] or $student->name}}
已知
? {{ isset($name)? $name: 'default' }}
可以簡寫為
? {{ $name or 'default'}}
??
那么
? {{old('student')['name'] ? old('student')['name']: $student->name}}
可否簡寫為
? {{old('student')['name'] or $student->name}}
2017-08-19
舉報
2017-08-20
截圖來自鏈接 http://www.xianlaiwan.cn/video/12524 (視頻4分42秒的時候)
我本來打算把截圖里的最后一行簡寫成 {{x or y}} 的形式的,結果就發現這問題了。
也就是說
? {{old('student')['name'] ? old('student')['name']: $student->name}}
不能簡寫成
? {{old('student')['name'] or $student->name}}
不知道為什么不行?。?/p>