Skip to content

Latest commit

 

History

History
46 lines (34 loc) · 1000 Bytes

README.md

File metadata and controls

46 lines (34 loc) · 1000 Bytes

this is a fork package from mitrii/yii2-embedjs

Yii2 embed JS

Embed JS with IDE checking or intellisense

Installation

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.

Usage

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(); ?>