ComponentHelper

Component helper class

since

1.5

Methods

filterText

Applies the global text filters to arbitrary text as per settings for current user groups

filterText(string $text) : string
static
since

2.5

Arguments

$text

stringThe string to filter

Response

stringThe filtered string

getComponent

Get the component information.

getComponent(string $option, boolean $strict = false) : \Joomla\CMS\Component\ComponentRecord
static
since

1.5

Arguments

$option

stringThe component option.

$strict

booleanIf set and the component does not exist, the enabled attribute will be set to false.

Response

\Joomla\CMS\Component\ComponentRecordAn object with the information for the component.

getComponentName

Returns the component name (eg. com_content) for the given object based on the class name.

getComponentName(object $object, string $alternativeName) : string
static

If the object is not namespaced, then the alternative name is used.

since

4.0.0

Arguments

$object

objectThe object controller or model

$alternativeName

stringMostly the value of getName() from the object

Response

stringThe name

getComponents

Get installed components

getComponents() : array<mixed,\Joomla\CMS\Component\ComponentRecord>
static
since

3.6.3

Response

array<mixed,\Joomla\CMS\Component\ComponentRecord>The components property

getParams

Gets the parameter object for the component

getParams(string $option, boolean $strict = false) : \Joomla\Registry\Registry
static
see \Joomla\Registry\Registry
since

1.5

Arguments

$option

stringThe option for the component.

$strict

booleanIf set and the component does not exist, false will be returned

Response

\Joomla\Registry\RegistryA Registry object.

isEnabled

Checks if the component is enabled

isEnabled(string $option) : boolean
static
since

1.5

Arguments

$option

stringThe component option.

Response

boolean

isInstalled

Checks if a component is installed

isInstalled(string $option) : integer
static
since

3.4

Arguments

$option

stringThe component option.

Response

integer

load

Load the installed components into the components property.

load() : boolean
static
since

3.2

Response

booleanTrue on success

renderComponent

Render the component.

renderComponent(string $option, array $params = array()) : string
static
since

1.5

throws

\Joomla\CMS\Component\Exception\MissingComponentException

Arguments

$option

stringThe component option.

$params

arrayThe component parameters

Response

string

Properties

components

The component list cache

static
since

1.6

Type(s)

array<mixed,\Joomla\CMS\Component\ComponentRecord>