Download the PHP package netglue/zf2-money-module without Composer

On this page you can find all versions of the php package netglue/zf2-money-module. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package zf2-money-module

ZF2 Money Module

No longer actively maintained - use at your own risk…

Whilst it's doubtful that you're using this lib, you shouldn't. It currently has a non-trivial issue that requires the lib to pin zend-form to 2.12.0. It's outdated and you should probably just import moneyphp/money and do your own wiring.


A Zend Framework 2 module intended to make it easier to work with money.

Code Climate Test Coverage

Essentially, this module imports Sebastian Bergmann's Money Library but probably controversially doesn't use it as a dependency with composer etc. The reason for this in the first instance was to get access to private static member vars in Currency but things have changed since first making this for ZF2 a long time ago. It's a useful module but really, it should be using moneyphp/money for its value objects. I have legacy code that uses the money VO's in the NetglueMoney namespace, so it's staying as-is for now but in future I'll probably migrate to moneyphp.

It's important to note that the Money value object stores the amount as an integer, the given currencies' smallest unit.

Install

$ composer require netglue/zf2-money-module

Available Components

Currency List

The currency list is intended to provide an easy way to configure the ISO currencies your app would be limited to using/accepting/whatever. A simple object that's retrievable form the service locator with 'NetglueMoney\Service\CurrencyList'. Take a look in module.config.dist.php for more info on configuration.

Currency Code Validator

Validates basic code format and also uses the currency list service to exclude codes that are not 'allowed' or unknown

Currency Select Element

A select element that should be retrieved via the FormElementManager if you want it's validator and list of available currencies to all point to the same currency list.

Within your form element config, you should refer to the select element with its fully qualified class name \NetglueMoney\Form\Element\SelectCurrency - A CurrencyCode validator will automatically be added to it.

Money Fieldset

A fieldset that will accept or hydrate to an instance of NetglueMoney\Money\Money. If you have a look at the tests you'll find an example of binding a model to a form that that hydrates the money instance.

View Helpers

moneyFormat()

Largely based on Zend\I18n\View\Helper\CurrencyFormat, but the parameters have been changed:

$money = new Money(123456, new Currency('GBP'));
echo $this->moneyFormat($money); // £1,234.56 (Assuming default locale of en_GB)
echo $this->moneyFormat($money, 'de_DE'); // 1.234,56 £
echo $this->moneyFormat($money, 'de_DE', false); // 1.234 £

You can also specify custom format patterns - look at NumberFormatter docs for more info.

Changelog

3.1.0

3.0.0

0.1.3

0.1.2

0.1.1

0.1.0

Future Plans


All versions of zf2-money-module with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1
ext-intl Version >=1
psr/container Version ^1.0
zendframework/zend-modulemanager Version ^2.8
zendframework/zend-form Version 2.12.0
zendframework/zend-view Version ^2.10
zendframework/zend-hydrator Version ^2.4
zendframework/zend-i18n Version ^2.9
zendframework/zend-escaper Version ^2.6
zendframework/zend-mvc Version ^3.1
zendframework/zend-code Version ^3.3
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package netglue/zf2-money-module contains the following files

Loading the files please wait ....