I am trying to echo result of a function using blade {!! !!}
Using like this {!! !!}
It shows the value that I need besides of showing 1
I have var dumped the function doing like this
{!! var_dump(ma_fonction)!!}
It shows me the result and after it , it shows bool(true)
Does anyone has an idea about this?
Thanks in advance
CodePudding user response:
its because of default behaviour of var_dump
function.
learn more here.
you could also consider var_export
CodePudding user response:
Very likely your function returns an array. And probably the last field in the array is a key => bool. For exapmple:
array(5) { ["description"]=> string(6) "<b>a</b>" ["isSomething"]=> string(4) "true" }
If you want print the description the use:
@php $data = ma_function(); @endphp
{!! $data['description'] !!}