function theme_link

Returns HTML for a link.

This is a wrapper around l() to allow for more flexible link themeing.

Where performance is more important than theme flexibility, Drupal code that outputs a link should call the l() function directly, as #theme 'link' implementations have a measurable performance impact.

Parameters

$variables: An associative array containing the keys 'text', 'path', and 'options'. See the l() function for information about these variables.

See also

l()

Related topics

1 string reference to 'theme_link'
system_update_8043 in drupal/core/modules/system/system.install
Move system theme settings from variable to config.
5 theme calls to theme_link()
CommonTestController::themeLinkActiveClass in drupal/core/modules/system/tests/modules/common_test/lib/Drupal/common_test/Controller/CommonTestController.php
Returns links to the current page, with and without query strings.
LanguageTestController::themeLinkActiveClass in drupal/core/modules/language/tests/language_test/lib/Drupal/language_test/Controller/LanguageTestController.php
Returns links to the current page with different langcodes.
UrlTest::testLinkCustomClass in drupal/core/modules/system/lib/Drupal/system/Tests/Common/UrlTest.php
Tests for custom class in links produced by l() and theme_link() functions.
UrlTest::testLinkRenderArrayText in drupal/core/modules/system/lib/Drupal/system/Tests/Common/UrlTest.php
Tests that link functions support render arrays as 'text'.
UrlTest::testLinkXSS in drupal/core/modules/system/lib/Drupal/system/Tests/Common/UrlTest.php
Confirms that invalid URLs are filtered in link generating functions.

File

drupal/core/includes/theme.inc, line 1686
The theme system, which controls the output of Drupal.

Code

function theme_link($variables) {
  return l($variables['text'], $variables['path'], $variables['options']);
}