Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 291237

Make l() optionally return structured output

$
0
0

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

  1. Patch
  2. Documentation
  3. Tests

- #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


Viewing all articles
Browse latest Browse all 291237

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>