API15:JComponentHelper/getComponent
From Joomla! Documentation
This Namespace has been archived - Please Do Not Edit or Create Pages in this namespace. Pages contain information for a Joomla! version which is no longer supported. It exists only as a historical reference, will not be improved and its content may be incomplete.
Contents |
Description
Get the component info
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
& 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
object A JComponent object
Defined in
libraries/joomla/application/component/helper.php
Importing
jimport( 'joomla.application.component.helper' );
Source Body
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
<CodeExamplesForm />
