shqear/yii2-embedjs

Embed JS with IDE checking or intellisense.

Installs: 41

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 1

Type:yii2-extension

dev-master 2018-04-24 17:31 UTC

This package is not auto-updated.

Last update: 2024-04-27 16:09:02 UTC


README

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