How to retrieve plugin path and absolute url?

Asked by jsherk

I noticed that I can retreive the path and name of the current menu with
$this->navigation->menuFile()

I don't see an easy way to get the plugin directory easily? I wrote a little function to extract it from menuFile but just wondering if there is an easy function that I missed

Also, what about retrieving the absolute path? I know you can use $configuration['absolute_path'] but the variable is not available from within a class/function. Should I just set global $configuration; to make it available within my class/function?

Thanks

Question information

Language:
English Edit question
Status:
Answered
For:
PHPDevShell Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
TitanKing (titan-phpdevshell) said :
#1

Try

$this->navigation->menuFile($this->configuration['m']);

To get the absolute url, simply do:
$this->navigation->selfUrl();

To get active plugin simpl do plugin:
$this->core->activePlugin();

Regards,
Jason

Revision history for this message
jsherk (jeff-forerunnertv) said :
#2

This:
$this->navigation->menuFile($this->configuration['m']);
and this:
$this->navigation->menuFile();

both give me the same result. I am not sure if they were supposed to or not.

This gives the absolute URL
$this->navigation->selfUrl();
but I wanted the absolute path.
I realized that all configuration variables are available thru $this so I can use this:
$this->configuration('absolute_path')
and don't have to declare: global $configuration

Does this $this->core->activePlugin(); give the plugin folder name or the name of the plugin as specified in the plugin.config file?

Thanks

Can you help with this problem?

Provide an answer of your own, or ask jsherk for more information if necessary.

To post a message you must log in.