Switch in Laravel 5 - Blade

后端 未结 8 538
南旧
南旧 2021-02-02 05:10

How can I use switch in blade templates? When I used:

@switch($login_error)
    @case(1)
        `E-mail` input is empty!
        @break
    @case(2)
        `Pa         


        
8条回答
  •  一生所求
    2021-02-02 05:41

    In Laravel 5.1, this works in a Blade:

    disposal ) {
            case 'DISPO': echo 'Send to Property Disposition'; break;
            case 'UNIT':  echo 'Send to Unit'; break;
            case 'CASCADE': echo 'Cascade the machine'; break;
            case 'TBD':   echo 'To Be Determined (TBD)'; break;
        }
    ?>
    

提交回复
热议问题