Blade view: if statement with OR/AND condition

前端 未结 2 902
轮回少年
轮回少年 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:25

    It should support all of your standard PHP operators, including || (logical OR).

    I have tested it myself and it works fine.

    Additionally, I would recommend simply testing this yourself in future to confirm it works/doesn't work.

提交回复
热议问题