this is a fork package from mitrii/yii2-embedjs
Embed JS with IDE checking or intellisense
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist shqear/yii2-embedjs "*"
or add
"shqear/yii2-embedjs": "*"
to the require section of your composer.json
file.
Once the extension is installed, simply use it in your code by :
<?php \shqear\widgets\Embedjs::begin(); ?>
<script type="text/javascript">
console.log('Hello, world!');
</script>
<?php \shqear\widgets\Embedjs::end(); ?>
Or with 'position' option (The default option is POS_END)
<?php \shqear\widgets\Embedjs::begin(['position' => \yii\web\View::POS_READY]); ?>
<script type="text/javascript">
console.log('Hello, world!');
</script>
<?php \shqear\widgets\Embedjs::end(); ?>