public static function getCurrencies($symbols = null)
    {
        $currencies = Cache::call("get-currencies", function() {
            $currencies = Yaml::decodeFromFile(__DIR__ . "/../data/currencies.yaml");

            if ($currencies instanceof SerialObject) {
                $currencies = $currencies->asArray();
            }

            return array_map(function($data) {
                if (!isset($data["prefix"])) {
                    $data["prefix"] = "";
                }
                if (!isset($data["suffix"])) {
                    $data["suffix"] = "";
                }
                return $data;
            }, $currencies);
        });

        if ($symbols) {
            return $currencies;
        }

        $return = [];
        foreach ($currencies as $key => $val) {
            $return[$key] = $val["title"];
        }

        return $return;
    }
public static function getCurrencies($symbols = null)
    {
        $currencies = Cache::call("get-currencies", function() {
            $currencies = Yaml::decodeFromFile(__DIR__ . "/../data/currencies.yaml");

            if ($currencies instanceof SerialObject) {
                $currencies = $currencies->asArray();
            }

            return array_map(function($data) {
                if (!isset($data["prefix"])) {
                    $data["prefix"] = "";
                }
                if (!isset($data["suffix"])) {
                    $data["suffix"] = "";
                }
                return $data;
            }, $currencies);
        });

        if ($symbols) {
            return $currencies;
        }

        $return = [];
        foreach ($currencies as $key => $val) {
            $return[$key] = $val["title"];
        }

        return $return;
    }
public static function getCurrencies ( $ symbols = null ) { $ currencies = Cache :: call ( "get-currencies" , function ( ) { $ currencies = Yaml :: decodeFromFile ( __DIR__ . "/../data/currencies.yaml" ) ; if ( $ currencies instanceof SerialObject ) { $ currencies = $ currencies -> asArray ( ) ; } return array_map ( function ( $ data ) { if ( ! isset ( $ data [ "prefix" ] ) ) { $ data [ "prefix" ] = "" ; } if ( ! isset ( $ data [ "suffix" ] ) ) { $ data [ "suffix" ] = "" ; } return $ data ; } , $ currencies ) ; } ) ; if ( $ symbols ) { return $ currencies ; } $ return = [ ] ; foreach ( $ currencies as $ key => $ val ) { $ return [ $ key ] = $ val [ "title" ] ; } return $ return ; }
Get the currencies supported by the Html class methods.

@param boolean $symbols Whether to return a multi-dimensional array with the symbols of a currency, or just the currency codes and their names

@return array Keyed by the currency code, value depends on the $symbols parameter
Get the currencies supported by the Html class methods .