antkaz / yii2-iview
The iView extension for the Yii framework
Installs: 18
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 4
Forks: 1
Open Issues: 0
Type:yii2-extension
Requires
- antkaz/yii2-vue: ~1.0
- npm-asset/iview: ~2.14.0
- yiisoft/yii2: ~2.0.14
Requires (Dev)
- phpunit/phpunit: ^5
This package is auto-updated.
Last update: 2020-02-14 20:07:52 UTC
README
IVIew Extension for Yii2
This is the IView UI extension based on Vue.js for Yii2. It allows you to use the components of the IView library in your application.
Documentation:
Installation
The preferred way to install this extension is through composer.
Run
php composer.phar require antkaz/yii2-iview
or add
"antkaz/yii2-iview": "dev-master"
to the require section of your composer.json
file.
Usage
After installing the extension, just use it in your code:
<?php use antkaz\iview\IViewAsset; use antkaz\vue\Vue; use \yii\web\JsExpression; IViewAsset::register($this); ?> <div class="iview"> <?php Vue::begin([ 'clientOptions' => [ 'data' => [ 'visible' => false ], 'methods' => [ 'show' => new JsExpression('function() {this.visible = true;}') ] ] ]) ?> <i-button @click="show">Click me!</i-button> <Modal v-model="visible" title="Welcome">Welcome to iView</Modal> <?php Vue::end() ?> </div>
The above example displays a button. Clicking this button opens a modal window.