robote13/yii2-cbr-webservices

Getting daily data on exchange rates, stock indexes e t.c. via CBR web services.

dev-master 2015-12-11 11:51 UTC

This package is auto-updated.

Last update: 2020-07-28 19:36:16 UTC


README

Getting daily data on exchange rates, stock indexes e t.c. via CBR web services

http://www.cbr.ru/scripts/Root.asp?PrtId=DWS

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist robote13/yii2-cbr-webservices "*"

or add

"robote13/yii2-cbr-webservices": "*"

to the require section of your composer.json file.

Usage

Once the extension is installed, simply use it in your code by :

!php

$service = new \robote13\CBRwebservice\CBRServicesAPI(CBRService::SERVICE_DAYINFO); 
$xml = $service->getData('CursOnDate',['On_date'=>$date]));

Also, for access to the service method can be used implemented wrapper-methods :

!php

$service = new \robote13\CBRwebservice\CBRServicesAPI(CBRService::SERVICE_DAYINFO); 
$xml = $service->exchangeRates();