Just submitted a new extension to the repository. The extension works with the European Central Bank daily feed rates. Should be the most accurate as it is coming from an official institution and most importantly: is free.
Please, use this topic to improve/report/suggest on this extension.
Cheers
PS: To download the extension go to :http://www.yiiframework.com/extension/ecurrencyhelper/
Ruganin
(Ruganin)
December 3, 2011, 1:16am
2
In many hosting shows error - "CURLOPT_FOLLOWLOCATION cannot be activated when safe_mode is enabled or an open_basedir is set"
For extansion thanks in handy.
Thanks for the tip, I think that by removing that option will be ok… Will update asap.
Cheers
Ruganin
(Ruganin)
December 14, 2011, 12:33am
4
Recently http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml often not available. Under this extension gives a fatal error (Fatal error: Call to a member function convert() on a non-object in ), apparently there is no check on the availability of data.
There is none as it is the European Central Bank Data… would do the check on availability…
Thanks again Ruganin, will update asap…
mmm… that error, Call to a member function convert() on a non-object… doesn’t mean there was the wrong data but that you use an object that is not set and then call a function name convert(). Don’t you think is weird?
Ruganin
(Ruganin)
December 14, 2011, 2:19am
7
Hmm, I’m new to php, probably made a mistake.
my code
Config main
'ecur'=>array(
'class'=>'application.extensions.eCurrency.ECurrencyHelper'
),
Extensions
class ECurrencyHelper extends CWidget
{
//...
Widget
class CurrencyWidget extends CWidget {
public function run() {
$usd = round(Yii::app()->ecur->convert('CZK','USD',1000),3);
$eur = round(Yii::app()->ecur->convert('CZK','EUR',1000),3);
$rub = round(Yii::app()->ecur->convert('CZK','RUB',1000),1);
$this->render('currencyWidget',array('usd'=>$usd, 'eur'=>$eur, 'rub'=>$rub));
}
}
layouts
$this->widget('application.components.CurrencyWidget');
views
echo $usd;
//...
The error appears when unavailable url BCE.
Or when problems in the channel hosting.
Ruganin
(Ruganin)
December 14, 2011, 3:33pm
8
It seems have found why appeared (Fatal error: Call to a member function convert () on a non-object in).
The site on which the error occurred, the extension is specified:
class ECurrencyHelper extends CApplicationComponent
{
//...
When correcting for (extends CWidget) problem has been resolved.
Forgot to update the file after creating a widget.
I apologize for the inconvenience, and not the correct information.
I have corrected this issue, new version allows CURLOPT_FOLLOWLOCATION for open_basedir off and has a workaround when this restriction is set.
Cheers
Ruganin
(Ruganin)
December 18, 2011, 9:38am
10
Fatal error: Call to undefined function init_get() in …\ECurrencyHelper.php on line 424
What’s the problem? How to decide?
Ohh man, what a silly mistype error!!! just change it to ini_get !!!!
Ruganin
(Ruganin)
December 18, 2011, 10:20am
12
Hmm, that’s a line from the downloaded new Extensions 1.0.2 of 16 December
if (init_get('open_basedir') == '' && ini_get('safe_mode') == 'Off')
Redownload of December 18, there is this bug is already fixed, it works.
Ruganin:
Hmm, that’s a line from the downloaded new Extensions 1.0.2 of 16 December
if (init_get('open_basedir') == '' && ini_get('safe_mode') == 'Off')
Redownload of December 18, there is this bug is already fixed, it works.
Great man… thanks for your feedback!
Cheesy
(Patrick Benie)
August 7, 2012, 11:29am
14
hey! im very new at yii!! i need help to install this extension!! im lost!!
thanks
Isnt it clear at its wiki? http://www.yiiframework.com/extension/ecurrencyhelper/
Just drop it on your extensions folder and you are ready to go, you just need to import it before use.