承接 haifahrul/yii2-autonumeric 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

haifahrul/yii2-autonumeric

Composer 安装命令:

composer require haifahrul/yii2-autonumeric

包简介

autoNumeric is a jQuery plugin that automatically formats currency and numbers as you type on form inputs.

README 文档

README

autoNumeric is a jQuery plugin that automatically formats currency and numbers as you type on form inputs.

Total Downloads

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist haifahrul/yii2-autonumeric "*"

or add

"haifahrul/yii2-autonumeric": "*"

to the require section of your composer.json file.

Formatter Settings (optional)

Default the thousandSeparator and decimalSeparator from Yii::$app->formatter, you can settings in your configuration file like below:

'components' => [
    'formatter' => [
        'class' => 'yii\i18n\formatter',
        'thousandSeparator' => '.',
        'decimalSeparator' => ',',
    ]
]

Usage

Once the extension is installed, simply use it in your code by:

The complete list of options are below. There are multiple ways of changing the options. To format "123456789.00" to "Rp. 123.456.789" you could do the following:

<?= $form->field($model, 'price')->widget(\haifahrul\autonumeric\AutoNumeric::classname(), [
        'value' => $model->price,
        'options' => [
            'id' => 'your-id',
            'class' => 'your-class',
            'readonly' => true,
            'disabled' => true,
        ],
        'pluginOptions' => [
            'aSep' => '.', // if you using Formatter Settings, this is not necessary
            'aDec' => ',', // if you using Formatter Settings, this is not necessary
            'aSign' => 'Rp. ',
            'mDec' => '0' // default 2
        ]
    ]);
?>

Other options you can see at http://www.yiiframework.com/doc-2.0/guide-helper-html.html

An example and other plugin options, you can see autoNumeric docs: https://github.com/BobKnothe/autoNumeric.

Thanks to extead. https://github.com/extead

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2016-05-23

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固