Answer the question
In order to leave comments, you need to log in
How in php from one class to make a call to other classes depending on their name?
Good day!
There was such question, I hope that I will formulate it is accessible.
The crux of the matter is this. There is a class object that receives a certain parameter as input, it is necessary to call the class depending on the name of this parameter (which is called like this parameter, while I think so).
For example:
Answer the question
In order to leave comments, you need to log in
php.net/manual/en/function.call-user-func.php
php.net/manual/en/function.call-user-func-array.php
php.net/manual/en/reflectionmethod.invoke.php
It seems you are doing something wrong. And I think you need to rebuild the application here using interfaces
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question