Documentation

includeModule

boolean public static
\Bitrix\Main\Loader::includeModule(
 string $moduleName
);

Static method connects module by its name. Returns true when connection is successful and false otherwise.

Similar to the method CModule::IncludeModule in the old core.

Parameters

ParameterDescriptionVersion
$moduleNameConnected module name.

Exceptions

Example

Example for connecting Analytics module.

if (\Bitrix\Main\Loader::includeModule('statistic'))
{
...//your code
}


© «Bitrix24», 2001-2024
Up