You are here

function hook_currency_amount_formatter_alter in Currency 8.3

Alters currency amount formatter plugins.

Parameters

array[] $definitions: Keys are plugin IDs. Values are plugin definitions.

1 invocation of hook_currency_amount_formatter_alter()
AmountFormatterManager::__construct in src/Plugin/Currency/AmountFormatter/AmountFormatterManager.php
Constructs a new instance.

File

./currency.api.php, line 27
Contains Currency hook documentation.

Code

function hook_currency_amount_formatter_alter(array &$definitions) {

  // Remove an amount formatter plugin.
  unset($definitions['foo_plugin_id']);

  // Replace an amount formatter plugin with another.
  $definitions['foo_plugin_id']['class'] = 'Drupal\\foo\\FooAmountFormatter';
}