Joomla get plugin id
Posted
by
Christian Sciberras
on Stack Overflow
See other posts from Stack Overflow
or by Christian Sciberras
Published on 2010-12-05T10:00:15Z
Indexed on
2010/12/30
23:54 UTC
Read the original article
Hit count: 160
I wrote a Joomla plugin which will eventually load a library.
The path to library is a plugin parameter, as such when the path is incorrect, a message pops up in the backend, together with a link to edit the plugin parameters:
/administrator/index.php?option=com_plugins&view=plugin&client=site&task=edit&cid[]=36
See the 36 at the end? That's my plugin's id in the database (table jos_plugins).
My issue is that this id changes on installation, ie, on different installs, it would be something else. So I need to find this id programmatically.
The problem is that I couldn't find this id from the plugin object itself (as to why not, that would be joomla's arguably short-sighted design decision).
So unless you know about some neat trick, (I've checked and double checked JPlugin and JPluginHelper classes), I'll be using the DB.
Edit; Some useful links:
- http://docs.joomla.org/Plugin_Developer_Overview
- http://api.joomla.org/Joomla-Framework/Plugin/JPlugin.html
- http://api.joomla.org/Joomla-Framework/Plugin/JPluginHelper.html
- http://forum.joomla.org/viewtopic.php?p=2227737
Guess I'll be using the wisdom from that last link...
© Stack Overflow or respective owner