davidyell / numbers_to_words
A helper for converting numbers into words
Installs: 2 616
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 2
Open Issues: 0
Type:cakephp-plugin
Requires
- ext-intl: *
- cakephp/cakephp: ~3.4
Requires (Dev)
- cakephp/cakephp-codesniffer: ^2.1
- phpunit/phpunit: ^5.6
README
A helper for CakePHP3 to convert numbers into words.
Have you ever wanted to use a number as a css class? Or title items in a loop, but number just look messy? I have, and so I made this quick plugin to solve that problem.
Installation
You can find the plugin listed on Packagist.
https://packagist.org/packages/davidyell/numbers_to_words
You can use this to require it into your CakePHP 3 project by adding it to your composer.json
file.
Configuration
You need to load the plugin in your config/bootstrap.php
Plugin::load('NumbersToWords');
You'll need to add it to your controllers helpers array and configure your locale.
public $helpers = [ 'NumbersToWords.NumbersToWords' => [ 'locale' => 'en_GB' ] ];
Usage
<?= $this->NumbersToWords->spell(5); // 'five';?>
Contribution
If you would like to add more conversions, please fork and submit a pull request.
License
See LICENSE