L functions should be one of the most frequently used functions of Drupal developers. Another possibility is the t function.
No matter how awesome you are, I can only say that you may find the l function manual no less than 10 times.
Basic usage:
$ Title: title
$ Url: connection address
L ($ title, $ url)
Add class
L ($ title, $ url, array ('bubuckets' => array ('class' => array ('myclass '))));
Add id
L ($ title, $ url, array ('bubuckets' => array ('id' => 'myid ')));
Add target = _ blank
L ($ title, $ url, array ('bubuckets' => array ('target' => '_ blank ')));
Add # top
L ($ title, $ url, array ('fragment '=> 'top '));
Add parameters? Name = terry? Gender = male
L ($ title, $ url, array ('query' => array ('name' => 'Terry ', 'gender' => 'male ')));
Connect to js
L ($ text, 'javascript: void (0) ', array ('fragment' => '', 'external '=> true ));
Link to image
$ Image = theme_image_style (array ('path' => $ image_path, 'style _ name' => '100x100 '));
L ($ image, '', array ('html' => TRUE ));
The code snippet of cingda:
Global $ base_url;
Print
L (
' field_image ['en'] [0] ['uri ']).'"/> ',
$ Base_url. $ node_url,
Array (
'Bubuckets' => array (
'Id' => 'My-id ',
'Class' => 'My-class'
),
'Query' => array (
'Foo' => 'bar'
),
'Fragment '=> 'refresh ',
'Html' => TRUE
)
);