M
M
Michael2015-03-18 20:10:54
PHP
Michael, 2015-03-18 20:10:54

Why doesn't the module page open in Bitrix?

Created a module following the example https://github.com/may-cat/maycat.d7dull
in the folder with the module created the admin folder, it contains two files:
menu.php - file with the
invoice_index.php menu structure
The module was installed, the items added to the menu also appeared, but when I try to open invoice_index.php it gives error 404.
I found in the documentation that this file should be included from the bitrix/admin folder. It
also says that when installing the module, these files should be copied to the admin folder and deleted when the module is removed. I just can’t understand, should they be automatically copied there, or do I need to write it myself in the doInstall () method?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander, 2015-03-19
@xmentor

You need it yourself.
Make the /install/admin directory in the module directory and put everything that needs to be copied to admin there.
It should be a file with the following content:

<?
require($_SERVER['DOCUMENT_ROOT'].'/bitrix/modules/НазваниеВашегоМодуля/admin/invoice_index.php');
?>

Well, in index.php in /install/:
function InstallFiles($arParams = array()) {
        CopyDirFiles(
        $_SERVER['DOCUMENT_ROOT'].'/bitrix/modules/НазваниеВашегоМодуля/install/admin',
        $_SERVER['DOCUMENT_ROOT'].'/bitrix/admin',
        true,
        true
      );
        return true;
    }

Something like this.

A
Alexey Emelyanov, 2015-03-18
@babarun

No need to create a module by copying another, use the module constructor.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question