kematjaya / price-bundle
8.0
2026-05-25 04:13 UTC
Requires
- php: >=8.1
- symfony/config: ^7.0|^8.0
- symfony/dependency-injection: ^7.0|^8.0
- symfony/event-dispatcher: ^7.0|^8.0
- symfony/form: ^7.0|^8.0
- symfony/http-kernel: ^7.0|^8.0
- symfony/intl: ^7.0|^8.0
- symfony/translation: ^7.0|^8.0
- symfony/yaml: ^7.0|^8.0
- twig/twig: ^3.14|^4.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.95
- phpstan/phpstan: ^2.1
- phpstan/phpstan-symfony: ^2.0
- phpunit/phpunit: ^9.5|^11.0
- symfony/browser-kit: ^7.0|^8.0
- symfony/framework-bundle: ^7.0|^8.0
- symfony/var-dumper: ^7.0|^8.0
This package is auto-updated.
Last update: 2026-05-25 04:15:10 UTC
README
Price/currency form type, number formatting, Indonesian terbilang & date formatting.
Supports Symfony 7+ and PHP 8.1+.
Installation
composer require kematjaya/price-bundle
Bundle Registration
// config/bundles.php Kematjaya\PriceBundle\PriceBundle::class => ['all' => true]
Configuration (optional)
# config/packages/price.yaml price: currency: code: IDR cent_limit: 0 cent_point: '.' thousand_point: ',' allow_negative: true
Twig Form Theme
# config/packages/twig.yaml twig: form_themes: - '@Price/bootstrap_5_price_layout.html.twig' # Bootstrap 5 - '@Price/bootstrap_4_price_layout.html.twig' # Bootstrap 4 - '@Price/bootstrap_3_price_layout.html.twig' # Bootstrap 3
Form Usage
use Kematjaya\PriceBundle\Type\PriceType; $builder->add('price', PriceType::class);
Twig Functions
{{ price(1000) }} {# Rp1.000 #}
{{ price(1000.22) }} {# Rp1.000,22 #}
{{ price_symbol() }} {# Rp #}
{{ thousand_point() }} {# . #}
{{ cent_point() }} {# , #}
{{ cent_limit() }} {# 0 #}
{{ allow_negative() }} {# true #}
{{ 15000|terbilang }} {# lima belas ribu #}
{{ date|date_format }} {# Senin, 25 Mei 2026 #}
{{ date|date_to_string }}{# dua puluh lima Mei dua ribu dua puluh enam #}