Get current class and method?
I'm not big on PHP but I believe it has "magic constants" similar to C/C++. Take a look here: This seems to indicate you could use
__LINE__, __FILE__, __FUNCTION__, __CLASS__, and __METHOD__
In the event you’re in a parent / base class, __CLASS__
will return the parent / base class name which is not desired. In that event you can use get_class()
:
get_class($this)