In this line we use the Package model static function getByID to load the package. The pkgID is available in the $c object which you can get to with $this->c inside any Dashboard Controller. We then call the getPackagePath function. The result is that $package_path will read something like "path-to-site/packages/package-name". No trailing slash.
$packagePath = Package::getByID($this->c->pkgID)->getPackagePath();
This same method may work on other single page controllers in packages but was only tested using a dashboard controller.
Loading Conversation