drupal_pre_render_link
- Versions
- 7
drupal_pre_render_link($elements)
#pre_render callback to render a link into #markup.
Doing so during pre_render gives modules a chance to alter the link parts.
Parameters
$elements A structured array whose keys form the arguments to l():
- #title: The link text to pass as argument to l().
- #href: The URL path component to pass as argument to l().
- #options: (optional) An array of options to pass to l().
Return value
The passed in elements containing a rendered link in '#markup'.
Code
includes/common.inc, line 4851
<?php
function drupal_pre_render_link($elements) {
$options = isset($elements['#options']) ? $elements['#options'] : array();
$elements['#markup'] = l($elements['#title'], $elements['#href'], $options);
return $elements;
}
?>Login or register to post comments 