Bitrix Namespace

\Bitrix - is a namespace that stores D7 methods. The system allows for developers to create custom classes and methods; however, they must be stored in corresponding custom namespaces.

The namespace allows assigning more specific clear names to system elements, without multiple prefixes and without potential conflicts. All classes, supplied in the standard installation package must be located in the \Bitrix namespace that is not related neither with PHP, nor partner's developers. Each standard module defines its own subspace that match with the module name within the \Bitrix namespace. For example, namespace \Bitrix\Forum is intended for a forum module, and for the main module - \Bitrix\Main.

When required, module can organize subspaces inside its namespace. For example, \Bitrix\Main\IO, \Bitrix\Forum\SomeName\SomeNameTwo. But this feature should be used only when it is warranted for organizing correct module architecture.

It's permissible to abridge full entry. Main\Class::Function() can be written instead \Bitrix\Main\Class::Function().

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