From 08c461b1a1a9da13005fd4c8c2c8ee91281c88f4 Mon Sep 17 00:00:00 2001 From: Anil Chaudhari Date: Tue, 9 Jul 2024 18:47:05 +0545 Subject: [PATCH] Update README.md --- README.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 8d9a176..1908a86 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ php composer.phar require --prefer-dist imanilchaudhari/yii2-currency-converter or add ``` -"imanilchaudhari/yii2-currency-converter": "3.0" +"imanilchaudhari/yii2-currency-converter": "3.1" ``` to the require section of your `composer.json` file. @@ -46,7 +46,7 @@ to the require section of your `composer.json` file. Usage ----- -Once the extension is installed, simply use it in your code by : +Once the extension is installed, use it in your code by adding the below code on the config's components : ```php 'components' => [ 'currencyConverter' => [ @@ -57,9 +57,11 @@ Once the extension is installed, simply use it in your code by : ], ... ], +``` +****and use as**** -$converter = Yii::$app->currencyConverter; -$rate = $converter->convert('USD', 'NPR'); +``` +$rate = Yii::$app->currencyConverter->convert('USD', 'NPR'); ``` @@ -76,7 +78,7 @@ $converter = new CurrencyConverter([ ]); $rate = $converter->convert('USD', 'NPR'); -print_r($rate); // it will print current Nepalese currency (NPR) rate according to USD +print_r($rate); // it will print the current Nepalese currency (NPR) rate according to USD ```