Answer the question
In order to leave comments, you need to log in
Can a template engine be used directly in JS?
Is it possible in the xxx.blade.php file where there is a JS script. Usability {{ somephpvariable }}? In the JS script itself, which is implemented in the view. Thanks :)
Answer the question
In order to leave comments, you need to log in
Can. There is also this , but it has not been updated for a long time and a bunch of issues are hanging. However, I do use it.
But the usual json_encode is also suitable, as laravel itself suggests (highlighted in blue).
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question