php - laravel print json without converting to htmlentities -
hi new templates , laravel.
i have changed laravel delimiters [[]] , [[[]]] using
blade::setcontenttags("[[", "]]"); blade::setescapedcontenttags("[[[", "]]]");
now want pass json javascript variable like
var somevariable = [[json_encode($variablefromcontroller)]];
but converts json string html entities
{"index":200}
i searched , found {{!!json_encode($variablefromcontroller)!!}}
should work doing in system [[!!json_encode($variablefromcontroller)!!]]
not makes impact.
i know can <?php echo json_encode($variablefromcontroller) ?>
last thing want try. there laravel specific thing can do?
at first blade::setcontenttags("[[", "]]");
means replace {!!
[[
. , blade::setescapedcontenttags("[[[", "]]]");
replacing {{
[[[
.
so condition [[ json_encode($variablefromcontroller) ]]
equivalent {!! json_encode($variablefromcontroller) !!}
Comments
Post a Comment