Hi I am new to templates and laravel.
I have changed the laravel delimiters to [[]] and [[[]]] using
Blade::setContentTags("[[", "]]");
Blade::setEscapedContentTags("[[[", "]]]");
Now I want to pass the json to a javascript variable like
var somevariable = [[json_encode($variableFromController)]];
but this converts the json string to html entities like
{"index":200}
I searched and Found that {{!!json_encode($variableFromController)!!}}
should work but doing this in my system like [[!!json_encode($variableFromController)!!]]
does not makes any impact.
I Know I can do something like <?php echo json_encode($variableFromController) ?>
but this is the last thing I want to try. is there any laravel specific thing I can do?