我有两个引用外部数据库的自定义组件。在 component1 中,我设置了连接到该外部数据库所需的参数。
有没有办法可以在component2中使用component1中的参数集?
我在组件2中的模型中的代码:
$app = JFactory::getApplication();
$params = $app->getParams('com_component1');
告诉我一个致命错误:
Fatal error: Call to undefined method JApplicationAdministrator::getParams() in /var/www....
我应该停止偷懒并在component2中重新定义相同的参数,还是有合理的解决方案?