PHPackages                             imanilchaudhari/yii2-currency-converter - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. imanilchaudhari/yii2-currency-converter

ActiveYii2-extension[Utility &amp; Helpers](/categories/utility)

imanilchaudhari/yii2-currency-converter
=======================================

This extension will help to find out current currency conversion rate.

3.2(1y ago)2011.6k10[1 PRs](https://github.com/imanilchaudhari/yii2-currency-converter/pulls)MITPHPPHP &gt;=7.4.0CI passing

Since Sep 10Pushed 4mo ago2 watchersCompare

[ Source](https://github.com/imanilchaudhari/yii2-currency-converter)[ Packagist](https://packagist.org/packages/imanilchaudhari/yii2-currency-converter)[ RSS](/packages/imanilchaudhari-yii2-currency-converter/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (6)Dependencies (4)Versions (10)Used By (0)

 [ ![](https://camo.githubusercontent.com/8317c17418b39410a660f5149071d26c5023c0d5fb2b7ebb771324812f666d73/68747470733a2f2f796969736f66742e6769746875622e696f2f646f63732f696d616765732f7969695f6c6f676f2e737667) ](imanilchaudhari/yii2-currency-converter)

Yii2 Currency Converter
=======================

[](#yii2-currency-converter)

[![Latest Stable Version](https://camo.githubusercontent.com/a0f98a52a67e4f3dd7b48856ccaa0cce8b8d8d62700d8f037c232291fe60987d/68747470733a2f2f706f7365722e707567782e6f72672f696d616e696c6368617564686172692f796969322d63757272656e63792d636f6e7665727465722f76)](https://packagist.org/packages/imanilchaudhari/yii2-currency-converter)[![Total Downloads](https://camo.githubusercontent.com/d7099d1a7dfa7b3ee812726fa03064a5d554353e0304471cf63ff4a2f3caf6dd/68747470733a2f2f706f7365722e707567782e6f72672f696d616e696c6368617564686172692f796969322d63757272656e63792d636f6e7665727465722f646f776e6c6f616473)](https://packagist.org/packages/imanilchaudhari/yii2-currency-converter)[![Build Status](https://camo.githubusercontent.com/7466cc25159cd5076c4b046ba285dc6ac0e17448fd4312692c870133b211159a/68747470733a2f2f7472617669732d63692e6f72672f696d616e696c6368617564686172692f796969322d63757272656e63792d636f6e7665727465722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/imanilchaudhari/yii2-currency-converter)[![Code Coverage](https://camo.githubusercontent.com/c3f7da077eb0f2b14f69b571e0b0bca38bc583430a40b8c5ef02b900e0ed7d09/68747470733a2f2f636f6465636f762e696f2f67682f696d616e696c6368617564686172692f796969322d63757272656e63792d636f6e7665727465722f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/imanilchaudhari/yii2-currency-converter)[![StyleCI](https://camo.githubusercontent.com/604d7c277304705277db2d6860650a9bfdc177cf3b1c9a2e4d247e9690a91157/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f34303230363238332f736869656c643f6272616e63683d6d6173746572)](https://github.styleci.io/repos/40206283?branch=master)[![License](https://camo.githubusercontent.com/2a39b6f74a78ef44af8e2d988181491c537585cdf46b310ac4ff69553aafd1b9/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f696d616e696c6368617564686172692f796969322d63757272656e63792d636f6e766572746572)](//packagist.org/packages/imanilchaudhari/yii2-currency-converter)

This extension will help to find out current currency conversion rate using various providers.

Documentation is at [docs/README.md](docs/README.md).

Version 1 docs are located at [here](https://github.com/imanilchaudhari/yii2-currency-converter/tree/1.1).

Requirements
------------

[](#requirements)

- PHP version 7.4 or later
- Curl Extension (Optional)

Installation
------------

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require --prefer-dist imanilchaudhari/yii2-currency-converter "3.1"

```

or add

```
"imanilchaudhari/yii2-currency-converter": "3.1"

```

to the require section of your `composer.json` file.

Usage
-----

[](#usage)

Once the extension is installed, use it in your code by adding the below code on the config's components :

```
'components' => [
    'currencyConverter' => [
        'class' => 'imanilchaudhari\CurrencyConverter\CurrencyConverter',
        'provider' => [
            'class' => 'imanilchaudhari\CurrencyConverter\Provider\ExchangeRatesApi',
        ],
    ],
    ...
],
```

**and use as**

```
$rate = Yii::$app->currencyConverter->convert('USD', 'NPR');

```

***OR***

```
use imanilchaudhari\CurrencyConverter\CurrencyConverter;
use imanilchaudhari\CurrencyConverter\Provider\ExchangeRatesApi;

$converter = new CurrencyConverter([
    'provider' => [
        'class' => ExchangeRatesApi::class,
    ],
]);
$rate =  $converter->convert('USD', 'NPR');

print_r($rate);  // it will print the current Nepalese currency (NPR) rate according to USD
```

Exchange Rate Providers
-----------------------

[](#exchange-rate-providers)

- [ApiForexApi](./src/Provider/ApiForexApi.php) - Get exchange rates from
- [CurrencyApi](./src/Provider/CurrencyApi.php) - Get exchange rates from
- [CurrencyFreaksApi](./src/Provider/CurrencyFreaksApi.php) - Get exchange rates from
- [CurrencylayerApi](./src/Provider/CurrencylayerApi.php) - Get exchange rates from
- [ExchangeRatesApi](./src/Provider/ExchangeRatesApi.php) - Get exchange rates from  (Free, no billing required)
- [FixerApi](./src/Provider/FixerApi.php) - Get exchange rates from
- [OpenExchangeRatesApi](./src/Provider/OpenExchangeRatesApi.php) - Get exchange rates from
- [UniRateApi](./src/Provider/UniRateApi.php) - Get exchange rates from  (Free, no credit card required.)

Testing
-------

[](#testing)

### Unit testing

[](#unit-testing)

The package is tested with [PHPUnit](https://phpunit.de/). To run tests:

```
./vendor/bin/phpunit
```

License
-------

[](#license)

The Yii2 Currency Converter is free software. It is released under the terms of the MIT License. Please see [`LICENSE`](./LICENSE.md) for more information.

[![Powered by](https://camo.githubusercontent.com/d6b0929173e28cc627430d2519ca1853466a70f37395877eaf4820cb3e1e1909/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f506f77657265645f62792d5969695f4672616d65776f726b2d677265656e2e7376673f7374796c653d666c6174)](https://www.yiiframework.com/)

###  Health Score

49

—

FairBetter than 95% of packages

Maintenance63

Regular maintenance activity

Popularity32

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 91.1% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~698 days

Recently: every ~638 days

Total

6

Last Release

403d ago

Major Versions

1.1 → 2.02024-02-26

2.0 → 3.02024-04-06

PHP version history (2 changes)1.0PHP &gt;=5.4.0

2.0PHP &gt;=7.4.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/a5c709c6d55b6bc7aabc22f380094a193a5d20b42d9a307a489bec4a3cd1bdd3?d=identicon)[imanilchaudhari](/maintainers/imanilchaudhari)

---

Top Contributors

[![imanilchaudhari](https://avatars.githubusercontent.com/u/6130886?v=4)](https://github.com/imanilchaudhari "imanilchaudhari (51 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (2 commits)")[![chaimleich](https://avatars.githubusercontent.com/u/7976661?v=4)](https://github.com/chaimleich "chaimleich (1 commits)")[![Robot72](https://avatars.githubusercontent.com/u/5987937?v=4)](https://github.com/Robot72 "Robot72 (1 commits)")[![StyleCIBot](https://avatars.githubusercontent.com/u/11048387?v=4)](https://github.com/StyleCIBot "StyleCIBot (1 commits)")

---

Tags

yii2extension

###  Code Quality

TestsPHPUnit

Static AnalysisRector

### Embed Badge

![Health badge](/badges/imanilchaudhari-yii2-currency-converter/health.svg)

```
[![Health](https://phpackages.com/badges/imanilchaudhari-yii2-currency-converter/health.svg)](https://phpackages.com/packages/imanilchaudhari-yii2-currency-converter)
```

###  Alternatives

[abei2017/yii2-wx

一个专注于yii2的微信sdk

1482.8k](/packages/abei2017-yii2-wx)[dmstr/yii2-cookie-consent

Yii2 Cookie Consent Widget

1452.6k](/packages/dmstr-yii2-cookie-consent)[richardfan1126/yii2-js-register

Yii2 widget to register JS into view

1357.2k7](/packages/richardfan1126-yii2-js-register)[degordian/yii2-webhooks

Yii2 extension for webhooks

117.1k](/packages/degordian-yii2-webhooks)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
