适用于 yii 框架中 textarea 的 Jquery autogrow 扩展
1.0.0
2015-01-24 04:13 UTC
This package is not auto-updated.
Last update: 2024-09-14 16:13:40 UTC
README
适用于 yii 框架中 textarea 的 Jquery autogrow 扩展
安装
安装此扩展的首选方式是通过 composer。
运行以下命令:
php composer.phar require --prefer-dist moonlandsoft/autogrow "*"
或者在您的 composer.json
文件的 require 部分添加:
"moonlandsoft/autogrow": "*"
```json
使用方法
扩展安装完成后,只需在您的代码中使用即可
<?= Autogrow::widget(['selector' => '.text-area-grow']); ?>
或者使用以下 jQuery 函数调用
<?= Autogrow::widget(['selector' => '.text-area-grow', 'functionName' => 'makeTextAutogrow']); ?>
对于小部件,您可以使用以下代码
<?= $form->field($model, 'attribute')->widget(AutogrowInput::className(), ['options' => ['class' => 'form-control']]); ?>