simialbi / yii2-widget-turbo
热加载 Turbo 的 Yii2 实现
1.2.0
2022-01-21 14:35 UTC
Requires
- php: >=7.4
- simialbi/yii2-simialbi-base: >=0.10.2 <1.0 | ^1.0.0
- yiisoft/yii2: ^2.0.0
Requires (Dev)
- phpunit/phpunit: ^7.5.20
- yiisoft/yii2-coding-standards: ~2.0
This package is auto-updated.
Last update: 2024-09-23 11:49:01 UTC
README
此存储库正在开发中。框架小部件已可以使用。
资源
安装
通过以下方式安装此扩展是首选方法:Composer。
运行以下命令之一:
$ php composer.phar require --prefer-dist simialbi/yii2-widget-turbo
或将以下内容添加到您的 composer.json
文件的 require
部分:
"simialbi/yii2-widget-turbo": "^1.0.0"
使用方法
示例用法
基本框架
<?php Frame::begin([ 'options' => [ 'id' => 'example-frame' ] ]); ?> <a href="/messages/expanded"> Show all expanded messages in this frame. </a> <form action="/messages"> Show response from this form within this frame. </form> <?php Frame::end();
急切加载的框架
<?php Frame::begin([ 'options' => [ 'id' => 'example-frame', 'src' => Url::to(['/messages']) ] ]); ?> Content will be replaced when /messages has been loaded. <?php Frame::end();
延迟加载的框架
<?php Frame::begin([ 'options' => [ 'id' => 'example-frame', 'src' => Url::to(['/messages']) ], 'lazyLoading' => true ]); ?> Content will be replaced when the frame becomes visible and /messages has been loaded. <?php Frame::end();
许可
yii2-widget-turbo 在 MIT 许可下发布。有关详细信息,请参阅打包的 LICENSE。