passing php variable from controller to javascript function in the head of a view

yeah sure, just echo the javascript: <?php echo '<script>var myPhpVariable = "'. $my_var . '";</script>'; ?>

Leave a Comment