title: Yii2 $this->registerJs($js); How to pass php variable inside the $js
body: <p>Below is my ajax script in my view.</p>
  
  <pre><code>$js = &lt;&lt;&lt; JS
      $('.list-link').click(function(){
          $.ajax({
              url: '?r=public/getlist&amp;param1=01&amp;param2=02&amp;param3=03',
              dataType: "json",
              success: function(data) {
                  $(".well").html(data.id);                
              }
          })
      });
  JS;
  $this-&gt;registerJs($js);
  </code></pre>
  
  <p>Now my problem is how am I going to make the values of param1, param2 and param3 dynamic like I am going to pass the params1 to 3 from php variables.</p>