Problem/Motivation
Namespaces can only be defined statically in .info.yml files. It would be nice if a module could dynamically define namespaces.
Proposed resolution
Add a module hook to define Twig namespaces dynamically.
API changes
Add hook_namespaces_alter().
Issue fork components-2909781
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
sonictruth commented+1 this would be lovely.
Comment #3
johnalbinComment #4
johnalbinNew features will need to go in Components 3.x.
Comment #5
johnalbinSince the primary way to define namespaces is with .info.yml files, the most-natural way to add a hook would be as an alter hook of the namespaces defined in .info.yml.
Comment #7
johnalbinComment #9
johnalbinComment #10
johnalbin