Actions

API16

JComponentHelper/getComponent

From Joomla! Documentation

< API16:JComponentHelper
Revision as of 21:56, 12 May 2013 by JoomlaWikiBot (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Replacement filing cabinet.png
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 information.

[<! removed edit link to red link >]

<! removed transcluded page call, red link never existed >

Syntax

static getComponent($option, $strict=false)
Parameter Name Default Value Description
$option $option The component option.
$strict false $string If set and a component does not exist, the enabled attribue will be set to false

Returns

object An object with the fields for the component.

Defined in

libraries/joomla/application/component/helper.php

Importing

jimport( 'joomla.application.component.helper' );

Source Body

public static function getComponent($option, $strict = false)
{
        if (!isset(self::$_components[$option])) {
                if (self::_load($option)){
                        $result = &self::$_components[$option];
                } else {
                        $result                         = new stdClass;
                        $result->enabled        = $strict ? false : true;
                        $result->params         = new JParameter;
                }
        } else {
                $result = &self::$_components[$option];
        }
 
        return $result;
}

[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >

Examples

<CodeExamplesForm />