armrck / yii2-touch-spin

一个用于管理输入旋转列表的 Yii2 输入小部件扩展,具有字段文本和字段数字。

dev-master 2017-09-19 00:55 UTC

This package is not auto-updated.

Last update: 2024-09-29 04:14:32 UTC


README

example

一个用于管理输入旋转列表的 Yii2 输入小部件扩展,具有字段文本和字段数字。

安装

安装此扩展的首选方法是通过 composer

运行以下命令之一

composer require --prefer-dist armrck/yii2-touchspin "*"

或将以下内容添加到您的 composer.json 文件的 require 部分。

"armrck/yii2-touchspin": "*"

用法

一旦安装了此扩展,只需在您的代码中通过以下方式使用它:

<?= TouchSpin::widget([
        'model' => $model, 
        'attribute1' => 'item', // Attribute 1 in your Model
        'attribute2' => 'item_qtd_aluno', // Attribute 2 in your Model
        'items' => ArrayHelper::toArray($model->alunoExpectativaItens) // Array
    ]);
?>