📜  laravel 刀片变量 isset,空或可选 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:13.877000             🧑  作者: Mango

代码示例1
// laravel optional parameter
{{ $variable ?? 'empty or write some message' }}
{{ $data ?? ' ' }}

// laravel variable is set or not
@isset($variable)
  // do some stuff when varaibale have value
@endisset
  
  // laravel varaible empty or not
  @empty ($variable)
  // do some stuff when varaibale have empty value
  @endempty