shaqman/yii2-inline-script
Composer 安装命令:
composer require shaqman/yii2-inline-script
包简介
Use inline javascripts inside view normally.
README 文档
README
Use inline javascripts inside view normally.
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist shaqman/yii2-inline-script
or add
"shaqman/yii2-inline-script": "*"
Usage
In your view:
use shaqman\widgets\inlinescript\InlineScript
... view ...
<?php InlineScript::begin([
'position' => View::POS_HEAD, // yii\web\view\registerJs parameter (optional)
'key' => 'tmp-script' // yii\web\view\registerJs parameter (optional)
]);
?>
<script>
$("#btn-submit").click(function () {
alert('hi');
});
</script>
<?php InlineScript::end(); ?>
... view ...
统计信息
- 总下载量: 486
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-09-26