I'm trying to find a way to get the filename of a subclass from a function defined in its parent class. I get that __FILE__ isn't going to work directly since it always returns the filename of the file it was used in, but there has to be someway short of redeclaring such a simple function in each and every sub class, right?
Code: Select all
//SuperClass.php
class SuperClass
{
public function getFile()
{
return __FILE__;
}
}
//SubA.php
class SubA extends SuperClass{}
//SubB.php
class SubB extends SuperClass{}
Thanks for your time,
Aaj