If you want the path to an file if you have i file structure like this
project -> system -> libs -> controller.php
project -> system -> modules -> foo -> foo.php
and foo() in foo.php extends controller() in controller.php like this
<?PHP
namespace system\modules\foo;
class foo extends \system\libs\controller {
public function __construct() {
parent::__construct();
}
}
?>
and you want to know the path to foo.php in controller() this may help you
<?PHP
namespace system\libs;
class controller {
protected function __construct() {
$this->getChildPath();
}
protected function getChildPath() {
echo dirname(get_class($this));
}
}
?>
<?PHP
$f = new foo(); // system\modules\foo
?>