M
M
mirexdoors2018-07-14 22:10:29
1C-Bitrix
mirexdoors, 2018-07-14 22:10:29

Why can a method in a native module fire twice?

Good day!
I started to cut my first module and immediately ran into the following problem:
When installing, I attach a function to the onAfterEpilog event

RegisterModuleDependences("main", "OnAfterEpilog", "modulname", "cMainClass", "AfterEpilog");

In the AfterEpilog function, I draw some kind of conclusion, it doesn’t matter.
class cMainClass {
  static $MODULE_ID = "modulname";

  function AfterEpilog(){
     echo "true";
  }
}

I include the class in include.php.
<?php
CModule::IncludeModule("modulname");
global $DBType;
$arClasses = array(
    'cMainClass '=>'classes/general/cMainClass .php'
);
CModule::AddAutoloadClasses("modulname", $arClasses);

And as a result, the result of the AfterEpilog function is returned twice: truetrue.
Where could be the problem?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question