What arguments should I pass to l() so that the generated link would open a new popup window? I have made my custom module in Drupal. I have a link that should open a popup window.

What arguments should I pass to l() so that the generated link would open a new popup window?
The link formatter function l() takes 3 arguments:

l($text, $path, array $options = array());


The $options array specifies the parameters to be passed to the link. One of them is $options['attributes'] which is itself an array and is used to specify the attributes of the anchor tag.

Use something like:

$options['attributes'] = array( 'target' =&gt; '_blank' );


when you are assembling the parameters to pass. This will open the link in a new window., which is the closest you can get with HTML.

For a real pop-up, you will have to add javascript to do the job, and adding something like:

$options['attributes'] = array( 'class' =&gt; 'popup' );


will give the javascript a target to use.