The Jquery autogrow extension for texarea in yii framework
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist moonlandsoft/autogrow "*"
or add
"moonlandsoft/autogrow": "*"
to the require section of your composer.json
file.
Once the extension is installed, simply use it in your code by :
<?= Autogrow::widget(['selector' => '.text-area-grow']); ?>
or use this with jquery function call :
<?= Autogrow::widget(['selector' => '.text-area-grow', 'functionName' => 'makeTextAutogrow']); ?>
For from widget, you can use code below :
<?= $form->field($model, 'attribute')->widget(AutogrowInput::className(), ['options' => ['class' => 'form-control']]); ?>