Skip to content

Cannot extend Twig with country_name filter #1272

Discussion options

You must be logged in to vote

Have a look here : https://learn.userfrosting.com/templating-with-twig/filters-and-functions#extending-twig-extensions

You can register the Twig Extension using the getTwigExtensions method in your recipe instead of using a Service:

    public function getTwigExtensions(): array
    {
        return [
            \Twig\Extra\Intl\IntlExtension::class,
        ];
    }

And don't forget to add the TwigExtensionRecipe implementation in your recipe.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by ablears
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants