https://github.com/codemonauts/craft-iban-field
https://github.com/codemonauts/craft-iban-field
Last synced: 10 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/codemonauts/craft-iban-field
- Owner: codemonauts
- License: mit
- Created: 2020-03-30T17:00:42.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2022-05-13T08:06:41.000Z (almost 4 years ago)
- Last Synced: 2024-04-17T02:03:18.754Z (almost 2 years ago)
- Language: PHP
- Size: 13.7 KB
- Stars: 2
- Watchers: 4
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# IBAN Field for Craft CMS

A field for storing, validating and formatting IBAN codes.
## Background
"The International Bank Account Number (IBAN) is an internationally agreed system of identifying bank accounts across national borders to facilitate the communication and processing of cross border transactions with a reduced risk of transcription errors." ([Wikipedia](https://en.wikipedia.org/wiki/International_Bank_Account_Number)).
This plugin adds a field type to store and validate IBAN codes. It provides a Twig extension to format IBANs in different formats.
## Requirements
* Craft CMS >= 4.0.0
## Installation
Open your terminal and go to your Craft project:
``` shell
cd /path/to/project
composer require codemonauts/craft-iban-field
./craft install/plugin iban
```
## Usage
After installation, the control panel can be used to create IBAN fields.
## Twig Filter
You can use the `|iban` filter to format an IBAN code in different ways. The default is `print`:
```twig
{{ entry.myIban|iban }}
{# Output: "DE89 3704 0044 0532 0130 00" #}
{{ entry.myIban|iban('print') }}
{# Output: "DE89 3704 0044 0532 0130 00" #}
{{ entry.myIban|iban('electronic') }}
{# Output: "DE89370400440532013000" #}
{{ entry.myIban|iban('anonymized') }}
{# Output: "XXXXXXXXXXXXXXXXXX3000" #}
```
With ❤ by [codemonauts](https://codemonauts.com)