I have traitA
in traitA.php
and classA
in classA.php
which uses that trait.
I need to get classA
file name inside of that trait. Can I do it somehow? __FILE__
returns traitA.php
I have traitA
in traitA.php
and classA
in classA.php
which uses that trait.
I need to get classA
file name inside of that trait. Can I do it somehow? __FILE__
returns traitA.php
SOLVED. I used
$reflection = new ReflectionClass('ClassA');
$classFileName = $reflection->getFileName();