Creating component preferences: Difference between revisions
From Joomla! Documentation
Radiant tech (talk | contribs) No edit summary |
No edit summary |
||
| Line 1: | Line 1: | ||
If you have an extension that uses plugins and a component, how do you access these component parameters in the plugin? I know that plugins can have their own parameters, but it would be good to consolidate them all in one place. So adding an example of how to access these component parameters from some other extension code would be very useful. | If you have an extension that uses plugins and a component, how do you access these component parameters in the plugin? I know that plugins can have their own parameters, but it would be good to consolidate them all in one place. So adding an example of how to access these component parameters from some other extension code would be very useful. [LATER] I have tested this in plugins and can retrieve the component parameters easily. So I added a note to that effect in the article. -Jonathan Cameron | ||
The method cited to obtain the parameter values for use in the component (&$mainframe->getParams() ) is not working for me. However, use of JComponentHelper::getParams('componentname') does work. Remember to include the JComponentHelper file with jimport('joomla.application.component.helper'). | The method cited to obtain the parameter values for use in the component (&$mainframe->getParams() ) is not working for me. However, use of JComponentHelper::getParams('componentname') does work. Remember to include the JComponentHelper file with jimport('joomla.application.component.helper'). | ||
Revision as of 18:32, 12 February 2008
If you have an extension that uses plugins and a component, how do you access these component parameters in the plugin? I know that plugins can have their own parameters, but it would be good to consolidate them all in one place. So adding an example of how to access these component parameters from some other extension code would be very useful. [LATER] I have tested this in plugins and can retrieve the component parameters easily. So I added a note to that effect in the article. -Jonathan Cameron
The method cited to obtain the parameter values for use in the component (&$mainframe->getParams() ) is not working for me. However, use of JComponentHelper::getParams('componentname') does work. Remember to include the JComponentHelper file with jimport('joomla.application.component.helper').