title: Passing JavaScript variable to createURL - YII Framework
body: <p>I am trying to pass javascript variable to Controller action by calling "CreateURL" function,</p>
  
  <p>JS Code:</p>
  
  <pre><code>Yii::app()-&gt;clientScript-&gt;registerScript('searchaevg', "
  $('#newAddval_btn').click(function(){
  var r = document.getElementById('cid').value;    
      window.location = '". yii::app()-&gt;createUrl('baseContact/add_refvalue',array("id" =&gt; ("#r"))). "'; });
  
  ");
  </code></pre>
  
  <p>Above code is not calling controller action, it throws </p>
  
  <pre><code>error "Error 400
  Your request is invalid."
  </code></pre>