我该如何在Blade模板中使用switch语句?当我尝试使用以下代码时:
@switch($login_error)
@case(1)
`E-mail` input is empty!
@break
@case(2)
`Password` input is empty!
@break
@endswitch
在结果中,我以纯文本形式看到这段文字。在我的一些代码片段中,我更喜欢使用switch语句,因为对我来说比使用if语句更清晰。
但如果不可能,那就写if语句。