Problem/Motivation
There is currently duplication between l(), theme_link() and theme_more_link(). Attempting to consolidate through a common function (like url_is_active) that all three call introduces a performance drop due to l() being called hundreds of times and having an extra function call.
Proposed resolution
Add a (render=>FALSE) flag to the options supplied to l() that causes l() to return an array of element structure rather than a string. The structured output can then be used directly by preprocess functions for Templates without duplicating the logic of creating a link.
Remaining tasks
- Patch
- Documentation
- Tests
Related Issues
- #1922454: Gut l(), fix theme('link'), have a working framework for consistently generated links inside and outside of Twig
- #1961876: Convert theme_link() to Twig
- #1939098: Convert theme_more_link() to Twig
- #1986116: Improve performance by only conditionally forcing small, very frequently rendered markup chunks through Twig templates