A
A
Alexander2020-05-15 10:29:57
1C-Bitrix
Alexander, 2020-05-15 10:29:57

How can you call methods of your class in Bitrix?

I have a custom Hlhelper class that contains methods for working with a highload block and it has a static GetHLelements method - returns a list of elements of a highload block by its ID.

The prompt class is located in the local/lib/hlhelper.php folder. Tell me

how can I access the methods of the Hlhelper class from other sections of the Bitrix code, for example, from component templates? Is it possible to do this without including a file in init.php, for example, calling a class via autoloading directly in the component template code?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim, 2020-05-15
@Tomio

If you have a class added to the autoloader (for example, via composer), then you can call it anywhere.
Otherwise, you will have to connect it one way or another anyway (in init or some other place)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question