Getting plugin parameters Topic is solved

Have a programming question regarding your component, plug-in, extension or core hacks? Have an interesting tidbit, FAQ or programming tip you’d like to share? This is the place for you.

Moderators: tjay, seadap, Rogue4ngel, matthewhayashida

Post Reply
mtlnews

Getting plugin parameters

Post by mtlnews » Sat Sep 15, 2007 1:25 pm

Hey,

Im trying to get the plugin parameters for a plugin like this:

$this->_params->get( 'THE_PARAMETER_I_WANT' )

but it obviously doesn't work. Can anyone help me out with this?

Thanks, Francis
Last edited by mtlnews on Sat Sep 15, 2007 9:42 pm, edited 1 time in total.

mtlnews

Re: Getting plugin parameters

Post by mtlnews » Sat Sep 15, 2007 2:02 pm

Actually,

I tryed using this insted:

$this->params->get( 'THE_PARAMETER_I_WANT' )

and in the construct function, instead of writing:

function plg( &$subject )
{
parent::__construct( $subject );

// load plugin parameters
$this->_plugin = JPluginHelper::getPlugin( 'PLUGIN_GROUP', 'PLUGIN_NAME' );
$this->_params = new JParameter( $this->_plugin->params );
}

like the tutorial suggests, I wrote:

function plg( &$subject, $params ) {
parent::__construct( $subject, $params );
}

and now it works wonderfully

User avatar
pe7er
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 162
Joined: Thu Aug 18, 2005 8:55 pm
Location: Nijmegen, The Netherlands
Contact:

Re: Getting plugin parameters

Post by pe7er » Sat Sep 15, 2007 2:52 pm

Great! Thanks for sharing!

PS: Could you please mark your first message in this thread as "solved" ? (Modify the first message and choose the Message Icon [solved] Image).
This way the list of messages shows that the question has been solved, and other users can benefit from it.
Thanks!
Kind Regards,
Peter Martin (aka pe7er)
db8.nl - Joomla! implementation, programming, template and component development [Dutch]
>> Questions? Get help more easily with JTS-post Assistant: viewtopic.php?f=428&t=272481

slongcgs

Re: Getting plugin parameters

Post by slongcgs » Sat Jan 12, 2008 2:07 am

Thanks, great tip!!!


Post Reply