Skip to content

Feature idea: option for opting out of specified extensions #52

@MichaelAllenWarner

Description

@MichaelAllenWarner

Since Twing has no mechanism for unregistering extensions, and since attempting to register an extension with the same name as one that's already been registered throws an error, it would be nice to be able to specify extensions that you don't want drupal-twig-extensions to register.

For example, right now the create_attribute() function that this package registers isn't useful in Twing, and consequently I'd like to register my own custom create_attribute(). But because of the limitations mentioned above, I find myself stuck: once this package registers create_attribute(), I can't unregister it, and I can't supply an override. If I could instruct drupal-twig-extensions not to register create_attribute(), I could get around this problem.

I envision something like:

addDrupalExtensions(twigOrTwingEnvironment, { exclude: ['create_attribute'] })

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions