定制 morbicer/converter-bundle 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

morbicer/converter-bundle

最新稳定版本:0.0.1

Composer 安装命令:

composer require morbicer/converter-bundle

包简介

Currency converting bundle for Symfony2. Supports multiple exchange rate providers.

README 文档

README

Currency converting bundle for Symfony2. Supports multiple exchange rate providers:

  • Yahoo (free)
  • Google (free)
  • Currency API (free)
  • chain (tries multiple if some is unavailable)

proper money handling using Martin Fowler's Money pattern implemented by mathiasverraes/money

1 Installation

1.1 Composer

"require": {
  ....
  "morbicer/converter-bundle": "dev"
},

or

php composer.phar require morbicer/converter-bundle

1.2 Enable the bundle

// app/AppKernel.php
public function registerBundles()
{
      $bundles = array(
        // ...
        new Morbicer\ConverterBundle\MorbicerConverterBundle(),
    );
}

1.3 Add config

# app/config.yml
morbicer_converter:
  default_provider: chain
  providers:
      yahoo: []
      google: []
      currency_api: []
      chain: [yahoo, currency_api, google]

Usage

//in controller, get service
$converter = $this->get('morbicer_converter.convert');
// $100 USD to EUR
$converted = $converter->convert(100, 'USD', 'EUR');
$result = array(
    'amount' => $converted->getAmount()/100,
    'currency' => (string)$converted->getCurrency(),
);

统计信息

  • 总下载量: 18
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 4
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 4
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-09-09

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固