Wednesday, October 29, 2014

Formatting a URL link in Drupal using function l

Another nice function in Drupal. It's called function l.
It formats a URL link as an HTML anchor tag.
I know it looks really easy and simple, it's just nice to use it after doing that manually many times.
$option = array();
$option['attributes'] = array('title' => $label);
l($label_trimmed, $uri['path'], $option));// will output [a href="$uri-path" title="$label">[/a]

No comments :