function theme_link

7.x theme.inc theme_link($variables)

Returns HTML for a link.

All Drupal code that outputs a link should call the l() function. That function performs some initial preprocessing, and then, if necessary, calls theme('link') for rendering the anchor tag.

To optimize performance for sites that don't need custom theming of links, the l() function includes an inline copy of this function, and uses that copy if none of the enabled modules or the active theme implement any preprocess or process functions or override this theme implementation.

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'
l in drupal/includes/common.inc
Formats an internal or external URL link as an HTML anchor tag.
3 theme calls to theme_link()
book_block_view in drupal/modules/book/book.module
Implements hook_block_view().
dblog_overview in drupal/modules/dblog/dblog.admin.inc
Page callback: Displays a listing of database log messages.
l in drupal/includes/common.inc
Formats an internal or external URL link as an HTML anchor tag.

File

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

Code

function theme_link($variables) {
  return '<a href="' . check_plain(url($variables['path'], $variables['options'])) . '"' . drupal_attributes($variables['options']['attributes']) . '>' . ($variables['options']['html'] ? $variables['text'] : check_plain($variables['text'])) . '</a>';
}