Difference between revisions of "JComponentHelper/getComponent"
From Joomla! Documentation
< API15:JComponentHelper
m (removing red link to edit, no existant pages) |
|||
Line 3: | Line 3: | ||
<span class="editsection" style="font-size:76%;"> | <span class="editsection" style="font-size:76%;"> | ||
− | <nowiki>[< | + | <nowiki>[<! removed edit link to red link >]</nowiki> |
</span> | </span> | ||
− | + | <! removed transcluded page call, red link never existed > | |
===Syntax=== | ===Syntax=== | ||
Line 57: | Line 57: | ||
<span class="editsection" style="font-size:76%;"> | <span class="editsection" style="font-size:76%;"> | ||
− | <nowiki>[< | + | <nowiki>[<! removed edit link to red link >]</nowiki> |
</span> | </span> | ||
− | + | <! removed transcluded page call, red link never existed > | |
===Examples=== | ===Examples=== | ||
Line 72: | Line 72: | ||
format= ,,, | format= ,,, | ||
</dpl> | </dpl> | ||
+ | [[Category:Archived pages API15]] |
Revision as of 08:52, 12 May 2013
The "API15" namespace is an archived namespace. This page contains information for a Joomla! version which is no longer supported. It exists only as a historical reference, it will not be improved and its content may be incomplete and/or contain broken links.
Description[edit]
Get the component info
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax[edit]
& getComponent($name, $strict=false)
Parameter Name | Default Value | Description |
---|---|---|
$name | $name The component name | |
$strict | false | $string If set and a component does not exist, the enabled attribue will be set to false |
Returns[edit]
object A JComponent object
Defined in[edit]
libraries/joomla/application/component/helper.php
Importing[edit]
jimport( 'joomla.application.component.helper' );
Source Body[edit]
function &getComponent( $name, $strict = false )
{
$result = null;
$components = JComponentHelper::_load();
if (isset( $components[$name] ))
{
$result = &$components[$name];
}
else
{
$result = new stdClass();
$result->enabled = $strict ? false : true;
$result->params = null;
}
return $result;
}
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples[edit]
<CodeExamplesForm />