ExpressionEngine® User Guide

Legacy Documentation

You are using the documentation for version 4.3.8. Go here for the latest version.

Addon Service

Simple Example

Read-only access to the data in an addon.setup.php file is made available via the object returned from a ee('Addon')->get($addon_name) call. The returned object has a get($key) method to retrieve data. For example:

$info = ee('Addon')->get('hello_world');
echo $info->get('description');

Addon Service Methods

class EllisLab\\ExpressionEngine\\Service\\Addon\Factory
EllisLab\\ExpressionEngine\\Service\\Addon\Factory::get($name)

Get an add-on object.

Parameters:
  • $name (string) – The short name of the add-on
Returns:

An Addon

Return type:

Addon

EllisLab\\ExpressionEngine\\Service\\Addon\Factory::all()

Get all add-ons.

Returns:An array of Addon objects
Return type:Array
EllisLab\\ExpressionEngine\\Service\\Addon\Factory::installed($name)

Get all the installed add-ons.

Returns:An array of Addon objects
Return type:Array

Addon Object Methods

EllisLab\ExpressionEngine\Service\Addon\Addon
EllisLab\\ExpressionEngine\\Service\\Addon\Factory::isInstalled()

Is this addon installed?

Returns:TRUE if it is, FALSE if not
Return type:Boolean
EllisLab\\ExpressionEngine\\Service\\Addon\Factory::hasUpdate()

Does this addon have an update available?

Returns:TRUE if it does, FALSE if not
Return type:Boolean
EllisLab\\ExpressionEngine\\Service\\Addon\Factory::getInstalledVersion()

Get the installed version

Returns:NULL if not installed or a version string
Return type:Mixed
EllisLab\\ExpressionEngine\\Service\\Addon\Factory::getFrontendClass()

Get the plugin or module class

Returns:The fqcn or $class
Return type:String
EllisLab\\ExpressionEngine\\Service\\Addon\Factory::getModuleClass()

Get the module class

Returns:The fqcn or $class
Return type:String
EllisLab\\ExpressionEngine\\Service\\Addon\Factory::getPluginClass()

Get the plugin class

Returns:The fqcn or $class
Return type:String
EllisLab\\ExpressionEngine\\Service\\Addon\Factory::getInstallerClass()

Get the *_upd class

Returns:The fqcn or $class
Return type:String
EllisLab\\ExpressionEngine\\Service\\Addon\Factory::getControlPanelClass()

Get the *_mcp class

Returns:The fqcn or $class
Return type:String
EllisLab\\ExpressionEngine\\Service\\Addon\Factory::getExtensionClass()

Get the extension class

Returns:The fqcn or $class
Return type:String
EllisLab\\ExpressionEngine\\Service\\Addon\Factory::hasManual()

Does this addon have a README.md file?

Returns:TRUE if it does, FALSE if not
Return type:Boolean
EllisLab\\ExpressionEngine\\Service\\Addon\Factory::hasFrontend()

Does this addon have module or plugin?

Returns:TRUE if it does, FALSE if not
Return type:Boolean
EllisLab\\ExpressionEngine\\Service\\Addon\Factory::hasInstaller()

Does this addon have a upd. file?

Returns:TRUE if it does, FALSE if not
Return type:Boolean
EllisLab\\ExpressionEngine\\Service\\Addon\Factory::hasControlPanel()

Does this addon have a mcp. file?

Returns:TRUE if it does, FALSE if not
Return type:Boolean
EllisLab\\ExpressionEngine\\Service\\Addon\Factory::hasModule()

Does this addon have a mod. file?

Returns:TRUE if it does, FALSE if not
Return type:Boolean
EllisLab\\ExpressionEngine\\Service\\Addon\Factory::hasPlugin()

Does this addon have a pi. file?

Returns:TRUE if it does, FALSE if not
Return type:Boolean
EllisLab\\ExpressionEngine\\Service\\Addon\Factory::hasExtension()

Does this addon have a ext. file?

Returns:TRUE if it does, FALSE if not
Return type:Boolean
EllisLab\\ExpressionEngine\\Service\\Addon\Factory::hasFieldtype()

Does this addon have a ft. file?

Returns:TRUE if it does, FALSE if not
Return type:Boolean
EllisLab\\ExpressionEngine\\Service\\Addon\Factory::getFieldtypeClasses()

Gets an array of the filedtype classes

Returns:An array of classes
Return type:Array
EllisLab\\ExpressionEngine\\Service\\Addon\Factory::getFieldtypeNames()

Get an associative array of names of each fieldtype. Maps the fieldtype’s shortname to it’s display name. The provider file is first checked for the display name in the fieldtypes key, falling back on the getName() method.

Returns:An associative array of shortname to display name for each fieldtype.
Return type:Array
EllisLab\\ExpressionEngine\\Service\\Addon\Factory::getProvider()

Get the add-on Provider

Returns:The add-on provider
Return type:EllisLab\ExpressionEngine\Core\Provider