Answer the question
In order to leave comments, you need to log in
How to correctly pass a parameter from YII2 d JS?
There is a widget, I registered its js, but I need to include variables from PHP (widget settings) in this js (which I connected via asset), how to do this, what to read?
Answer the question
In order to leave comments, you need to log in
Directly:
for scalar types:
for objects you can use the json format:
$this->view->registerJs(sprintf(" var a = %s ", json_encode($o)));
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question