kematjaya / price-bundle
Installs: 1 228
Dependents: 1
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- symfony/config: ^7.0
- symfony/dependency-injection: ^7.0
- symfony/event-dispatcher: ^7.0
- symfony/form: ^7.0
- symfony/http-kernel: ^7.0
- symfony/intl: ^7.0
- symfony/yaml: ^7.0
- twig/twig: ^3.14
Requires (Dev)
- phpunit/phpunit: ^9.5
- symfony/browser-kit: ^7.0
- symfony/framework-bundle: ^7.0
- symfony/var-dumper: ^7.0
README
Price Type Extension for Symfony 4
-
installation
composer require kematjaya/price-bundle
-
add to bundles.php
Kematjaya\PriceBundle\PriceBundle::class => ["all" => true]
-
add in twig.yaml
twig: form_themes: .... - '@Price/bootstrap_5_price_layout.html.twig' ## for bootstrap 5 - '@Price/bootstrap_4_price_layout.html.twig' ## for bootstrap 4 - '@Price/bootstrap_3_price_layout.html.twig' ## for bootstrap 3 ....
-
Usage 3.1. Form
... use Kematjaya\PriceBundle\Type\PriceType; ... $builder->add("price", PriceType::class); ...
3.2. Twig
- terbilang
{{ terbilang(1000) }} // seribu {{ terbilang(40000) }} // empat puluh ribu
- price format
{{ price(1000) }} // IDR 1,000 {{ price(1000.22) }} // IDR 1,000.22 {{ price(4500) }} // IDR 4,500