Please help me with this
I am creating a component. There is a config.xml in my component I write my custom JFormFieldUserCheck in userCheck.php I want to load parameter or field from config.xml
I used
$param = JComponentHelper::getParams('com_my-component');
var_dump($param);
Resul is
object(stdClass)#214 (0) { }
But when I change com_my-component to com_content (Joomla default component). then var_dump, result is fine.
Thanks in advance
Clearly, Joomla isn't understanding your component. Insure that it's properly installed in Joomla, and that the xml file for the component is accurate and formed properly. If Joomla does find your component, or is unable to load the XML, then the parameters cannot be made available to your PHP. These steps are done with the valid entries in the database, and the XML, both of which are typically done with the component installation, but can be done manually as long as you get them all correct.
I have added an excerpt from the blog entry:
Plugin parameters from inside a plugin
Plugin parameters from outside a plugin
Module parameters from inside a module
Module parameters from outside a module
Component parameters from inside a component
Component parameters from outside a component
Template parameters from inside a template
Template parameters from outside a template
Template parameters from an included file outside the Joomla framework
Had the same problem. The result was empty until i went to the configuration of my component and saved it (though there were default values printed in the textfields).