simialbi / yii2-widget-turbo
Yii2 implementation of hotwired turbo
Installs: 801
Dependents: 2
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 3
Open Issues: 0
Language:JavaScript
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-11-23 12:08:42 UTC
README
This repository is work in progress. The Frame widget can already be used.
Resources
Installation
The preferred way to install this extension is through composer.
Either run
$ php composer.phar require --prefer-dist simialbi/yii2-widget-turbo
or add
"simialbi/yii2-widget-turbo": "^1.0.0"
to the require
section of your composer.json
.
Usage
Example Usage
Basic Frame
<?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();
Eager loaded frame
<?php Frame::begin([ 'options' => [ 'id' => 'example-frame', 'src' => Url::to(['/messages']) ] ]); ?> Content will be replaced when /messages has been loaded. <?php Frame::end();
Lazy loaded frame
<?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();
License
yii2-widget-turbo is released under MIT license. See bundled LICENSE for details.