Download the PHP package newism/craft3-money without Composer

On this page you can find all versions of the php package newism/craft3-money. 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 craft3-money

Money plugin for Craft CMS 3.x

Requirements

This plugin requires Craft CMS 3.5.0 or later.

Installation

To install the plugin, follow these instructions.

  1. Open your terminal and go to your Craft project:

  2. Then tell Composer to load the plugin:

  3. In the Control Panel, go to Settings → Plugins and click the “Install” button for Money or run

Money Overview

Money is a custom field type and formatter that uses the moneyphp/money library. Values are stored as json in the database and normalized as a Money Value Object.

Currencies are loaded from the moneyphp/money library. A full list can be found here: https://github.com/moneyphp/money/blob/master/resources/currency.php

This plugin also loads in symfony/intl for currency names.

Configuring Money

Money has two levels of configuration:

Note: Field settings are appended to Site settings.

The two settings are:

Both settings accept a comma delimited list of alphabetical currency codes.

It's recommended that you exclude the following currencies: XBA, XBB, XBC, XBD, XTS, XXX, XAU, XPD, XPT, XAG

To use a config file see ./src/config.php.

Using Money

This plugin includes a service for rendering the field value.

Note: In the three methods below value must be an instance of Money. The examples use the 'Elvis Operator'.

International formatter

{{ value ? craft.money.intlFormatter.format(value) }}

# or explicitly define the locale
{{ value ? craft.money.getIntlFormatter(locale).format(value) }}

The intlFormatter returns a [IntlMoneyFormatter](http://moneyphp.org/en/stable/features/formatting.html#intl-money-formatter) object. This formatter requires the intl extension.

Calling .format() will return a string with the currency symbol in a format that matches locale. Separators will also match the locale.

locale is an optional parameter and falls back to the locale defined by Craft: \Craft::$app->locale->id

See: http://moneyphp.org/en/stable/features/formatting.html#intl-money-formatter

International Decimal Formatter

{{ value ? craft.money.intlDecimalFormatter.format(value) }}

# or explicitly define the locale
{{ value ? craft.money.getIntlDecimalFormatter(locale).format(value) }}

Outputs the same as above without the currency symbol.

See: http://moneyphp.org/en/stable/features/formatting.html#intl-decimal-formatter

Decimal Formatter

{{ value ? craft.money.decimalFormatter.format(value) }}

This formatter outputs a simple decimal string which is always in a consistent format independent of locale.

Money Roadmap

Some things to do, and ideas for potential features:

Credits

Brought to you by Newism


All versions of craft3-money with dependencies

PHP Build Version
Package Version
Requires craftcms/cms Version ^3.4
moneyphp/money Version ^3.3
symfony/intl Version ^5.0
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 newism/craft3-money contains the following files

Loading the files please wait ...