5

I want to get <a href="http://site.ru/node/123">New product</a> from l(), and I call it as l('New product', 'node/123'), but this function generates a URL that is not absolute.

How can I generate an absolute URL with l()?

2 Answers 2

23

You can make a link absolute with:

l(t('New product'), 'node/123', array('absolute' => TRUE));

See l() and url() for more.

0
2

Check out l() and the options in url() for how to construct a link with or without http: but basically you need to set the absolute option to TRUE.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.