PHPackages                             davidyell/currency-exchange - 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. davidyell/currency-exchange

ActiveCakephp-plugin[Utility &amp; Helpers](/categories/utility)

davidyell/currency-exchange
===========================

A CakePHP 3 helper for displaying prices in various currencies

0.0.4(8y ago)4601[1 issues](https://github.com/davidyell/CakePHP-CurrencyExchange/issues)PHP

Since Aug 18Pushed 8y ago2 watchersCompare

[ Source](https://github.com/davidyell/CakePHP-CurrencyExchange)[ Packagist](https://packagist.org/packages/davidyell/currency-exchange)[ Docs](https://bitbucket.org/ukwm/campaigns-plugins-currencyexchange/overview)[ RSS](/packages/davidyell-currency-exchange/feed)WikiDiscussions 3.x Synced 1mo ago

READMEChangelogDependencies (2)Versions (5)Used By (0)

Currency Exchange
=================

[](#currency-exchange)

A helper for CakePHP 3 which will display a currency in a different currency using current exchange rates.

It will cache the result and check the response before invalidating the cache to ensure that your site always serves some currency data, even if it's a little stale. The data is cached for a year and updated using a shell.

[![Build Status](https://camo.githubusercontent.com/dffec13c5275c219cfab4ec02f46a7337dcbffd6e808a4c192527002b2630041/68747470733a2f2f7472617669732d63692e6f72672f646176696479656c6c2f43616b655048502d43757272656e637945786368616e67652e7376673f6272616e63683d332e78)](https://travis-ci.org/davidyell/CakePHP-CurrencyExchange)

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

[](#requirements)

- CakePHP 3.x
- PHP 5.4.16+
- Currencylayer.com api account

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

[](#installation)

You can require it with `composer require "davidyell/currency_exchange:3.x-dev"`

Set your Currency Layer API key.

-
-

`Configure::write('currencyLayer.apikey', "YourApiKeyGoesHere");`

Helper
------

[](#helper)

The helper is provided to do the front-end conversion when displaying prices in different currencies. The helper takes a number of options to configure its behaviour.

### Helper configuration

[](#helper-configuration)

When you are adding the helper to your `$helpers` array in your controller, you can pass an array of options. The defaults are shown below as an example. If you're happy with the defaults you don't need to pass any configuration.

```
// src/View/AppView.php
    $this->loadHelper('CurrencyExchange.Currency', ['targetCurrency' => 'GBP']);
```

Shell
-----

[](#shell)

A shell is provided to allow updating of the cached exchange rate data via a cron job. This prevents the request having to wait to see if the remote api is available before returning data to the user.

Instead you can set the shell to run on a cron as often as you need and it will update the data in the background, keeping your front-end quick for your users and your data fresh.

Updating the cache
------------------

[](#updating-the-cache)

The frequency at which the cache is updated is controller by how often you chose to run the shell task. I'd recommend setting a cron job which runs once a week to update the cache.

```
bin/cake currency_exchange.rates update GBP
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance15

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 83.3% 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 ~295 days

Total

4

Last Release

3038d ago

Major Versions

0.0.3 → 3.x-dev2016-09-21

### Community

Maintainers

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

---

Top Contributors

[![davidyell](https://avatars.githubusercontent.com/u/49889?v=4)](https://github.com/davidyell "davidyell (5 commits)")[![curtisgibby](https://avatars.githubusercontent.com/u/1086964?v=4)](https://github.com/curtisgibby "curtisgibby (1 commits)")

---

Tags

currencycakephppricesexchangeexchange rates

### Embed Badge

![Health badge](/badges/davidyell-currency-exchange/health.svg)

```
[![Health](https://phpackages.com/badges/davidyell-currency-exchange/health.svg)](https://phpackages.com/packages/davidyell-currency-exchange)
```

###  Alternatives

[florianv/swap

Exchange rates library for PHP

1.3k6.4M16](/packages/florianv-swap)[florianv/laravel-swap

Currency exchange rates library for Laravel and Lumen

3342.0M2](/packages/florianv-laravel-swap)[dereuromark/cakephp-tools

A CakePHP plugin containing lots of useful and reusable tools

338920.1k32](/packages/dereuromark-cakephp-tools)[ujjwal/currency-converter

Currency Converter Class with features of caching and identifying currency from country Code

49225.4k](/packages/ujjwal-currency-converter)[dereuromark/cakephp-dto

A CakePHP plugin for generating immutable Data Transfer Objects with full type safety

2988.9k3](/packages/dereuromark-cakephp-dto)[loadsys/cakephp_sitemap

A CakePHP Plugin for adding automatic XML and HTML Sitemaps to an app

2819.6k](/packages/loadsys-cakephp-sitemap)

PHPackages © 2026

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