Documentation

Loader

Loader class loads the required files, classes and modules. It's a single class that is enabled directly. Used for connecting all modules, except main and fileman.

Similar to the CModule from the old core.

Method Description Available from version
autoLoad Loads methods, registered for autoloading
getDocumentRoot Returns document root.
getLocal Checks for existing file in /local or /bitrix directories.
getPersonal Checks for existing file in personal directory.
includeModule Connects module by its name.
includeSharewareModule Connects partner module by its name.
registerAutoLoadClasses Registers classes for autoloading.
[link=13576296]registerNamespace[/link] Registers a namespace.

Example

// D7
use Bitrix\Main\Loader;
Loader::includeModule("iblock");
Loader::includeSharewareModule("eeeeee.tips"); 


User Comments

User comments are not part of official documentation. Use information provided by other users in the comments at your own risk.

The User Comments section is not to be used as a feature discussion board. Only registered users can post comments. Your comment will be visible once it has been approved by the moderator.
© «Bitrix24», 2001-2022