Actions

JModuleHelper/getModule

From Joomla! Documentation

Revision as of 09:20, 7 November 2008 by Batch1211 (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Adds the definition of a linked external script to the document object. Duplicates are ignored.

Syntax

void addScript( $url, $type )

where:

Argument Data type Description Default
$name string The name of the module
$title string The title of the module, optional null

Example

To add a link to some JavaScript code at a specific URL, you could use:

jimport('joomla.application.module.helper');
$module = JModuleHelper::getModule('login');
echo '<pre>';
print_r($module);
echo '</pre>';
/*
stdClass Object
(
    [id] => 18
    [title] => Login Form
    [module] => mod_login
    [position] => left
    [content] => 
    [showtitle] => 1
    [control] => 
    [params] => cache=0
                moduleclass_sfx=_login
                pretext=
                posttext=
                login=
                logout=
                greeting=1
                name=1
                usesecure=0
    [user] => 0
    [name] => login
    [style] => 
)
 
*/

See also