A
A
Alexey Kravchinsky2018-02-28 19:27:29
1C-Bitrix
Alexey Kravchinsky, 2018-02-28 19:27:29

How to place the module in the administrative part?

Good evening. tell me in which file to write the code for placing the menu item to control the operation of the module? ps as far as I understand, then in the include.php file. is it true, or am I wrong?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman Gritsuk, 2018-02-28
@winer

I understand that your question is "How to add a menu item in the admin panel?".
To do this, add an event handler for the OnBuildGlobalMenu event .
the handler can be placed both in the include.php of the module and in the lib folder of the module.
The event itself will be easier to register in the module installer using

<?
$moduleID = "vendor.module";//код вашего модуля

RegisterModuleDependences("main", "OnBuildGlobalMenu", $moduleID, "\Vendor\ClassName", "onBuildGlobalMenuHandler");//старый стиль

//новый стиль
$eventManager = \Bitrix\Main\EventManager::getInstance();
$eventManager->registerEventHandlerCompatible("main", "OnBuildGlobalMenu", $moduleID, "\Vendor\ClassName", "onBuildGlobalMenuHandler");

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question