Hi,
this outputs nothing
@if(!isset($bla)) (complete) @else ({{ $missing }} missing) @endif
but if i spread it via single lines
@if(!isset($bla))
(complete)
@else
({{ $missing }} missing)
@endif
it works!
It should output (complete) or (123 missing)
Is Blade confused because of some braces?
Thanks, Sharping
Blade expects them all to be on individual lines. Consider using the {{ $blah ? "(complete)" || "({$missing} missing)" }}
syntax if you'd like it on one line. Another alternative is placing this into a presenter object.
machuga said:
{{ $bla ? "(complete)" || "({$missing} missing)" }}
This outputs error: syntax error, unexpected ';'
<?php echo $bla ? "(complete)" || "({$missing} missing)"; ?>
Sharping said:
machuga said:
{{ $bla ? "(complete)" || "({$missing} missing)" }}
This outputs error: syntax error, unexpected ';'
<?php echo $bla ? "(complete)" || "({$missing} missing)"; ?>
Try this instead:
{{ ($bla) ? '(complete)' : "($missing missing)" }}
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community