title: Php variables in javascript code
body: <p>I have the code below in a helper function, where I try to redirect the user to a link after an event occurs.</p>
  
  <pre><code>static public function redirect($path)
  {       
      echo '&lt;script type="text/javascript"&gt;';
      echo 'self.parent.location.href = "$path";';
      echo '&lt;/script&gt;';        
  }
  </code></pre>
  
  <p>In my case I call the function as <code>Helper_Popup::redirect("/account/my_addresses")</code> but, of course, it redirects me to a link <code>something/$path</code>. How should I 'embed' the php variable in the above code?</p>