R
R
RabIN2019-01-27 00:00:09
1C-Bitrix
RabIN, 2019-01-27 00:00:09

Why such an error "Class not found (0)"?

[Error] Class 'Has\Module\CompanyPoints' not found (0)

<?
namespace Has\Module;

use \Bitrix\Main\Config\Option;
use \Bitrix\Main\UserTable as User;

class CompanyPoints{
      function func(){return true;}
}
?>

test.php
use \Bitrix\Main\Loader;

    use \Bitrix\Main\Application;

    use \Has\Module\CompanyPoints;

    Loader::includeModule("Module");

    $addresses=CompanyPoints::func();

the error "Class not found (0)" gets out, why does it occur?
new class in partner module in new file.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey, 2019-01-28
@AlexeyCaTHaR

Check:
1) whether the module is connected
2) whether the file for Autoload is named correctly. It may well be that the module is connected, but the class is not loaded.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question