Igo*_*iuk 1 properties exists laravel
如何$this->team->playerAssignment->player更合理地检查现有财产?现在,我像这样检查它:
if ($this->team)
if (($this->team->playerAssignment))
if (($this->team->playerAssignment->player))
Run Code Online (Sandbox Code Playgroud)
小智 5
尝试使用isset php函数。
isset —确定是否设置了变量并且不为NULL
if(isset($this->team->playerAssignment->player)){
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4932 次 |
| 最近记录: |