定制 execut/yii2-autosize-textarea 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

execut/yii2-autosize-textarea

最新稳定版本:1.0.2

Composer 安装命令:

composer require execut/yii2-autosize-textarea

包简介

Autosize textarea widget for Yii2 based on jquery.ns-autogrow plugin

README 文档

README

Plugin page

Installation

The preferred way to install this extension is through composer.

Install

Either run

$ php composer.phar require execut/yii2-autosize-textarea "dev-master"

or add

"execut/yii2-autosize-textarea": "dev-master"

to the require section of your composer.json file.

Example

use execut\autosizeTextarea\TextareaWidget;

class Model extends \yii\base\Model {
    public $text = null;
    public function rules()
    {
        return [['text', 'safe']];
    }
}

$form = \yii\widgets\ActiveForm::begin();
echo $form->field(new \Model(), 'text')->widget(TextareaWidget::class, [
    'options' => [
        'style' => 'height: 30px', // If you want set textarea height
    ],
    'clientOptions' => [
        'vertical' => true, //(true/false) - Enable/Disable vertical autogrow (true by default)
        'horizontal' => true, //(true/false) - Enable/Disable horizontal autogrow (true by default)
        'postGrowCallback' => new JsExpression('function () {console.debug(\'post grow callback\');}'),
        //Post grow callback. Executes after dimensions of textarea have been adjusted.
        'flickering' => true, //(true/false) - Enable/Disable flickering.
        //If flickering is disabled, extra line will be added to textarea.
        //Flickering is enabled by default.
        'debugx' => -10000, // X position of shadow element (-10000 by default)
        'debugy' => -10000, // Y position of shadow element (-10000 by default)
        'debugcolor' => 'yellow', // Color of shadow element (yellow by default)
    ]
]);
\yii\widgets\ActiveForm::end();

Example autosize textarea widget for Yii2

License

yii2-autosize-textarea is released under the Apache License Version 2.0. See the bundled LICENSE.md for details.

统计信息

  • 总下载量: 383
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: Apache-2.0
  • 更新时间: 2019-07-09