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