0
When I try to use the operator "or" in the Blade it processes wrong and the Undefined variable. I’m calling it that:
{{ $confirmed or false }}
But he’s compiling it like this:
<?php echo e($confirmed or false); ?>
0
When I try to use the operator "or" in the Blade it processes wrong and the Undefined variable. I’m calling it that:
{{ $confirmed or false }}
But he’s compiling it like this:
<?php echo e($confirmed or false); ?>
1
The basic correct use is:
{{ $confirmed or 'false' }}
In case you’re trying to put the false
as an element, not a string
or variável
.
I put @if ($Confirmed or 'false') and still gave Undefined variable
1
Try it like this:
{{ isset($confirmed) ? 'valor se ok' : 'valor se nao existe'; }}
or use the form below to return the value of the variable itself:
{{ isset($confirmed) ? $confirmed : 'valor se nao existe'; }}
Browser other questions tagged php laravel laravel-blade
You are not signed in. Login or sign up in order to post.
what is your intention? whether the $Confirmed variable exists? whether it is true? explains better
– Italo Rodrigo
if true, if not, I automatically want to receive false
– Igor Oliveira