Here is my code, I want to put an array of answers in just one @elseif line
@if( $selectSummaryTable == 'MemType' )
Summary of Members
@elseif( $report_type == ['Category', 'CivilStatus'] )
Baptism Report for {{ $report_date }}
@endif
How do you correctly put multiple values in the @elseif line?
Blade is the simple, yet powerful templating engine that is included with Laravel. Unlike some PHP templating engines, Blade does not restrict you from using plain PHP code in your templates.
The Blade is a powerful templating engine in a Laravel framework. The blade allows to use the templating engine easily, and it makes the syntax writing very simple. The blade templating engine provides its own structure such as conditional statements and loops.
Blade directives are shortcut codes for the implementation of basic PHP structure control, such as loop and conditional statements. It makes your code snippets clean and easy to understand.
You can use in_array function , change your code from
@elseif( $report_type == ['Category', 'CivilStatus'] )
to
@elseif(in_array($report_type,['Category', 'CivilStatus']))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With