simialbi/yii2-widget-turbo

热加载 Turbo 的 Yii2 实现

安装: 722

依赖: 2

建议者: 0

安全: 0

星标: 0

关注者: 3

分支: 3

开放问题: 0

语言:JavaScript

1.2.0 2022-01-21 14:35 UTC

This package is auto-updated.

Last update: 2024-09-23 11:49:01 UTC


README

Latest Stable Version Total Downloads License build

此存储库正在开发中。框架小部件已可以使用。

资源

安装

通过以下方式安装此扩展是首选方法: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