Getting Plugin Parameters

1,805 views
Skip to first unread message

Aman Gautam

unread,
Oct 19, 2010, 2:02:20 PM10/19/10
to Joomla! CMS Development
Hii All,
Is there a standard way to get a specific plugin parameters from an
component??

Like, what should I use to get the content/
example( plgContentExample ) parameters from any
component( com_example )?

PS: I use J!1.6
and I tried $pparams = $this->params; (inside the plugin) but it gives
the params of the caller component instead

Regards
Aman Gautam

Sam Moffatt

unread,
Oct 23, 2010, 1:38:30 AM10/23/10
to joomla-...@googlegroups.com
Plugin params are per plugin and there isn't anything more specific
from there. You could build them out that way but the core doesn't
support plugin params beyond what is in the plugins table.

You can get plugin details via JPluginHelper which I think gives you
the params as well.

Cheers,

Sam Moffatt
http://pasamio.id.au

> --
> You received this message because you are subscribed to the Google Groups "Joomla! CMS Development" group.
> To post to this group, send an email to joomla-...@googlegroups.com.
> To unsubscribe from this group, send email to joomla-dev-cm...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/joomla-dev-cms?hl=en-GB.
>
>

Aman Gautam

unread,
Oct 23, 2010, 10:27:26 AM10/23/10
to joomla-...@googlegroups.com
Thanks Sam :)
We have a method to get params of an component called JComponentHelper::getParams() I am wondering why such function is not present in JPluginHelper.
Well I am making a function for my code, but I guess it will be helpful to have such a function in core too..

Regards
Aman Gautam

Sam Moffatt

unread,
Oct 23, 2010, 10:33:35 PM10/23/10
to joomla-...@googlegroups.com
Getting component params is considered more reasonable than pulling an
entire plugin out. JPluginHelper::getPlugin($type, $plugin) will
return the plugin.

$plugin = JPluginHelper::getPlugin('authentication', 'ldap');
$params = new JParameter($plugin->params);

$params will function like normal JParameter object and enable you to
get values.


Sam Moffatt
http://pasamio.id.au

Reply all
Reply to author
Forward
0 new messages