Hi,Aaron
Would you like to tell me more about :"http://www.pixelclever.com/how-and-why-use-l-function-create-links-drupal-programming"?
as that:
which file should I put the following code into? :
l($text, $path, $options = array())
or the example: print l('This is the link text', 'node/2');
$options = array(
'attributes' => array(),
'html' => TRUE,
);
l('', 'node/1', $options);
should I type the code in the page.tpl.php or the others?
The l() function can be used
The l() function can be used anywhere that php can be used within Drupal. That means from within any module, within template.php, or any include file that gets called by a module or theme. It basically is just a replacement for doing something like this:
print $output;
Using l() insures that the link starts from the correct context (starting from the base path) and it adds active classes and other information that you wouldn't want to have to calculate on your own.
Post new comment