Last active
September 20, 2016 21:38
-
-
Save loganhenson/90bb7d0c5207c4b549561ba6f30045a3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// for use with laravel elixir elm gist: https://gist.github.com/loganhenson/5594e1a6259e830aa42479550b130e3e | |
function elm($app_name, $flags = []) | |
{ | |
ob_start(); ?> | |
<div id="<?= $app_name ?>"></div> | |
<script src="/js/<?= $app_name ?>.js"></script> | |
<script> | |
Elm.Main.embed( | |
document.getElementById('<?= $app_name ?>'), | |
<?= json_encode($flags) ?> | |
); | |
</script> | |
<?php return ob_get_clean(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment