2017 © Pedro Peláez
 

yii2-extension yii2-money

An advanced money mask input for Yii 2.0 based on jquery maskmoney plugin styled for Bootstrap 3.

image

stratoss/yii2-money

An advanced money mask input for Yii 2.0 based on jquery maskmoney plugin styled for Bootstrap 3.

  • Thursday, September 10, 2015
  • by stratoss
  • Repository
  • 1 Watchers
  • 0 Stars
  • 8 Installations
  • JavaScript
  • 0 Dependents
  • 0 Suggesters
  • 22 Forks
  • 0 Open issues
  • 18 Versions
  • 0 % Grown

The README.md

yii2-money

Latest Stable Version License Total Downloads Monthly Downloads Daily Downloads, (*1)

An advanced money mask input for Yii Framework 2 based on jQuery-maskMoney plugin. The plugin offers a simple way to create masks to your currency form fields. The yii2-money extension includes these additional enhancements in order to use the maskMoney plugin effectively:, (*2)

  • default styling for Bootstrap 3 and supports Yii Active Field validations
  • automatically read a float/decimal and convert it to the money format on field load
  • automatically convert back the field to a float/decimal for saving once the mask is changed (maintains an internal hidden field)
  • allows global settings of the mask money plugin options via Yii::$app->params

Demo

You can see detailed documentation on usage of the extension., (*3)

Latest Release

The latest version of the extension is release v1.2.1. Refer the CHANGE LOG for details of various releases., (*4)

Installation

The preferred way to install this extension is through composer., (*5)

Note: Check the composer.json for this extension's requirements and dependencies. Read this web tip /wiki on setting the minimum-stability settings for your application's composer.json., (*6)

Either run, (*7)

$ php composer.phar require kartik-v/yii2-money "dev-master"

or add, (*8)

"kartik-v/yii2-money": "dev-master"

to the require section of your composer.json file., (*9)

Usage

Global Settings

You can globally set the plugin options for your money format across the application in the params section of your Yii configuration file. You need to set the maskMoneyOptions in your Yii application params. For example:, (*10)

'params' => [
    'maskMoneyOptions' => [
        'prefix' => 'US$ ',
        'suffix' => ' c',
        'affixesStay' => true,
        'thousands' => ',',
        'decimal' => '.',
        'precision' => 2, 
        'allowZero' => false,
        'allowNegative' => false,
    ]
]

Formatter Settings

If you have not setup params like above, the plugin will default the thousandSeparator and decimalSeparator from Yii::$app->formatter settings in your configuration file., (*11)

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

MaskMoney

You can configure the widget as shown below. Any plugin option not passed, will be defaulted from the above two sections (params and formatter). Note that properties directly set in pluginOptions at the widget level as shown below, will override other global settings., (*12)

use kartik\money\MaskMoney;
echo MaskMoney::widget([
    'name' => 'currency',
    'value' => 122423.18,
    'pluginOptions' => [
        'prefix' => '$ ',
    ],
]); 

License

yii2-money is released under the BSD 3-Clause License. See the bundled LICENSE.md for details., (*13)

The Versions

10/09 2015

dev-master

9999999-dev https://github.com/kartik-v/yii2-money

An advanced money mask input for Yii 2.0 based on jquery maskmoney plugin styled for Bootstrap 3.

  Sources   Download

BSD 3-Clause

The Requires

 

extension yii2 jquery bootstrap widget currency money mask format bootstrap 3

10/09 2015

v999.6

999.6.0.0 https://github.com/kartik-v/yii2-money

An advanced money mask input for Yii 2.0 based on jquery maskmoney plugin styled for Bootstrap 3.

  Sources   Download

BSD 3-Clause

The Requires

 

extension yii2 jquery bootstrap widget currency money mask format bootstrap 3

07/09 2015

v999.5

999.5.0.0 https://github.com/kartik-v/yii2-money

An advanced money mask input for Yii 2.0 based on jquery maskmoney plugin styled for Bootstrap 3.

  Sources   Download

BSD 3-Clause

The Requires

 

extension yii2 jquery bootstrap widget currency money mask format bootstrap 3

06/09 2015

v999.3

999.3.0.0 https://github.com/kartik-v/yii2-money

An advanced money mask input for Yii 2.0 based on jquery maskmoney plugin styled for Bootstrap 3.

  Sources   Download

BSD 3-Clause

The Requires

 

extension yii2 jquery bootstrap widget currency money mask format bootstrap 3

06/09 2015

v999.4

999.4.0.0 https://github.com/kartik-v/yii2-money

An advanced money mask input for Yii 2.0 based on jquery maskmoney plugin styled for Bootstrap 3.

  Sources   Download

BSD 3-Clause

The Requires

 

extension yii2 jquery bootstrap widget currency money mask format bootstrap 3

06/09 2015

v999.2

999.2.0.0 https://github.com/kartik-v/yii2-money

An advanced money mask input for Yii 2.0 based on jquery maskmoney plugin styled for Bootstrap 3.

  Sources   Download

BSD 3-Clause

The Requires

 

extension yii2 jquery bootstrap widget currency money mask format bootstrap 3

06/09 2015

999.0

999.0.0.0 https://github.com/kartik-v/yii2-money

An advanced money mask input for Yii 2.0 based on jquery maskmoney plugin styled for Bootstrap 3.

  Sources   Download

BSD 3-Clause

The Requires

 

extension yii2 jquery bootstrap widget currency money mask format bootstrap 3

06/09 2015

v999.1

999.1.0.0 https://github.com/kartik-v/yii2-money

An advanced money mask input for Yii 2.0 based on jquery maskmoney plugin styled for Bootstrap 3.

  Sources   Download

BSD 3-Clause

The Requires

 

extension yii2 jquery bootstrap widget currency money mask format bootstrap 3

17/06 2015

v1.2.1

1.2.1.0 https://github.com/kartik-v/yii2-money

An advanced money mask input for Yii 2.0 based on jquery maskmoney plugin styled for Bootstrap 3.

  Sources   Download

BSD 3-Clause

The Requires

 

extension yii2 jquery bootstrap widget currency money mask format bootstrap 3

25/11 2014

1.2.0.x-dev

1.2.0.9999999-dev https://github.com/kartik-v/yii2-money

An advanced money mask input for Yii 2.0 based on jquery maskmoney plugin styled for Bootstrap 3.

  Sources   Download

BSD 3-Clause

The Requires

 

extension yii2 jquery bootstrap widget currency money mask format bootstrap 3

25/11 2014

v1.2.0

1.2.0.0 https://github.com/kartik-v/yii2-money

An advanced money mask input for Yii 2.0 based on jquery maskmoney plugin styled for Bootstrap 3.

  Sources   Download

BSD 3-Clause

The Requires

 

extension yii2 jquery bootstrap widget currency money mask format bootstrap 3

25/11 2014

v1.2.0.x-dev

1.2.0.9999999-dev https://github.com/kartik-v/yii2-money

An advanced money mask input for Yii 2.0 based on jquery maskmoney plugin styled for Bootstrap 3.

  Sources   Download

BSD 3-Clause

The Requires

 

extension yii2 jquery bootstrap widget currency money mask format bootstrap 3

20/11 2014

1.1.0.x-dev

1.1.0.9999999-dev https://github.com/kartik-v/yii2-money

An advanced money mask input for Yii 2.0 based on jquery maskmoney plugin styled for Bootstrap 3.

  Sources   Download

BSD 3-Clause

The Requires

 

extension yii2 jquery bootstrap widget currency money mask format bootstrap 3

20/11 2014

v1.1.0

1.1.0.0 https://github.com/kartik-v/yii2-money

An advanced money mask input for Yii 2.0 based on jquery maskmoney plugin styled for Bootstrap 3.

  Sources   Download

BSD 3-Clause

The Requires

 

extension yii2 jquery bootstrap widget currency money mask format bootstrap 3

20/11 2014

v1.1.0.x-dev

1.1.0.9999999-dev https://github.com/kartik-v/yii2-money

An advanced money mask input for Yii 2.0 based on jquery maskmoney plugin styled for Bootstrap 3.

  Sources   Download

BSD 3-Clause

The Requires

 

extension yii2 jquery bootstrap widget currency money mask format bootstrap 3

05/10 2014

1.0.0.x-dev

1.0.0.9999999-dev https://github.com/kartik-v/yii2-money

An advanced money mask input for Yii 2.0 based on jquery maskmoney plugin styled for Bootstrap 3.

  Sources   Download

BSD 3-Clause

The Requires

 

extension yii2 jquery bootstrap widget currency money mask format bootstrap 3

05/10 2014

v1.0.0

1.0.0.0 https://github.com/kartik-v/yii2-money

An advanced money mask input for Yii 2.0 based on jquery maskmoney plugin styled for Bootstrap 3.

  Sources   Download

BSD 3-Clause

The Requires

 

extension yii2 jquery bootstrap widget currency money mask format bootstrap 3

05/10 2014

v1.0.0.x-dev

1.0.0.9999999-dev https://github.com/kartik-v/yii2-money

An advanced money mask input for Yii 2.0 based on jquery maskmoney plugin styled for Bootstrap 3.

  Sources   Download

BSD 3-Clause

The Requires

 

extension yii2 jquery bootstrap widget currency money mask format bootstrap 3