Answer the question
In order to leave comments, you need to log in
How to get caller class name PHP
How to get the name of the class that called the action in the parent class?
Example:
class ParentClass {
function action() {
echo $className;
}
}
class ChildClass extends ParentClass {}
$parentClass = new ParentClass();
$parentClass->action(); // ParentClass
$childClass = new ChildClass();
$childClass->action(); // ChildClass
Answer the question
In order to leave comments, you need to log in
class ParentClass {
function action() {
echo get_class($this);
}
}
That is, roughly speaking. The problem is that the start can take a value either from the cross table or from the clutch table?
The description of the question is not too clear, I would make a schematic in workbeanch or something like that. There would be more answers.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question