Blade view: if statement with OR/AND condition

前端 未结 2 906
轮回少年
轮回少年 2021-02-07 08:02

Is it possible in Laravel 4.0 -blade-view to do an if statment like so?

@if ($var1 === \'1\' OR $var2 === \'1\')
    //Do my stuff
@endif
         


        
2条回答
  •  庸人自扰
    2021-02-07 08:38

    You can simply use and / or operators:

    @if($a==1 and $b==2)
    @if($a==1 or $b==2)
    

提交回复
热议问题