R
R
Rishat Sultanov2017-07-31 15:09:02
JavaScript
Rishat Sultanov, 2017-07-31 15:09:02

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

1 answer(s)
A
Alex Wells, 2017-07-31
@rishatss

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 question

Ask a Question

731 491 924 answers to any question