danilovl/apply-filter-twig-extension-bundle
Symfony Twig bundle that adds an apply_filter() function to call Twig filters dynamically from templates. Choose filter names at runtime and apply them to values (e.g., upper/lower/max), enabling flexible rendering logic.
upper, lower, max) directly in Twig templates, reducing backend logic and improving frontend flexibility. Ideal for dashboards, admin panels, or user-facing tools where data formatting varies by context (e.g., case sensitivity, sorting).apply_filter('truncate', content, 100)).apply_filter(user.filterPreference, data)).{% if %} to dynamically alter data display (e.g., {{ apply_filter(isAdmin ? 'fullData' : 'sanitize', data) }}).array_walk() or Laravel Collections.htmlspecialchars)."This package lets our frontend templates dynamically format data—like converting text to uppercase or sorting lists—without touching backend code. It’s like giving designers/developers a ‘Ctrl+F’ for data transformations. For example, we could let admins toggle between ‘raw’ and ‘formatted’ data in dashboards with zero backend changes. Low risk (MIT license, minimal dependencies), high reward for agility."
*"A lightweight Symfony bundle that adds a {{ apply_filter('filterName', data) }} Twig function. Key benefits:
formatForAdmin().{% apply_filter %}.Call to Action: "Let’s trial this in [Project X]’s dashboard templates. If it cuts 20% of our controller logic, we’ll save dev time and reduce merge conflicts."
How can I help you explore Laravel packages today?