How to get component parameters?

前端 未结 8 1676
萌比男神i
萌比男神i 2020-12-24 11:35

I have a problem here and just cant solve it :-/

I am developing an Joomla component with backend. In the backend I set a parameter, the dashboardId, bu

相关标签:
8条回答
  • 2020-12-24 12:35

    There's a more simple way. First import Joomla Component Helper:

    jimport('joomla.application.component.helper'); // not required in Joomla 3.x
    

    And then retrieve any attribute you want like this:

    $params = JComponentHelper::getParams('com_dashboard');
    $dashboardID = $params->get('dashboardID');
    

    Greetings.

    0 讨论(0)
  • 2020-12-24 12:38

    I had a similar problem. I only got the data:protected result until I went to the configuration of my component and saved it. Though there were default values printed in the textfields Joomla wasn't able to read them before clicking on 'save'.

    0 讨论(0)
提交回复
热议问题