hostnet/financial-twig-extension-bundle
Hostnet Financial Twig Extension Bundle adds Twig filters and functions for financial calculations and formatting, helping Symfony templates handle values like VAT, interest, and currency display without extra PHP logic. Simple to install and integrate.
Install the bundle:
composer require hostnet/financial-twig-extension-bundle
Register it in config/bundles.php if Symfony Flex did not do it automatically:
Hostnet\FinancialTwigExtensionBundle\HostnetFinancialTwigExtensionBundle::class => ['all' => true],
Look first at the README and src/Twig/ in the package. The bundle exposes Twig filters/functions for displaying financial values. Typical filters are money, currency, percentage, or vat, but confirm the exact names in the source.
First use case: format a Money value object in a template.
{{ order.total|money }}
{{ product.price|currency('EUR') }}
Pass Money objects (e.g., from hostnet/financial or MoneyPHP) from your controller or service. Avoid passing raw floats to financial filters.
Money value objects, then render them with Twig filters.Money objects. Use one money library throughout the application (likely hostnet/financial or MoneyPHP). This ensures the Twig filters receive the expected object type.debug:twig to discover filters. Run php bin/console debug:twig to list available filters and functions, especially when upgrading or onboarding.intl extension is installed so currency and number formatting respects locale rules.composer.json and test upgrades.src/Twig/ and clear the Symfony cache. Bundle registration and cache clearing fix most “unknown filter” errors.How can I help you explore Laravel packages today?