ventaquil ventaquil - 1 year ago 310
PHP Question

Switch in Laravel 5 - Blade

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

`E-mail` input is empty!
`Password` input is empty!

in result I see this text as plaintext. I prefer to use switch in few piece of code because it's more clean for me than when I using if.

But if it's not possible just write it.

Answer Source

Unfortunately Laravel Blade does not have switch statement. You can use Laravel if else approach or use use plain PHP switch. You can use plain PHP in blade templates like in any other PHP application.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download