如何直接访问 Joomla 组件中的默认参数值?

How to directly access the default param values in Joomla components?

我正在进行 Joomla 3 组件编辑。现在我遇到了一个问题:当我安装我的组件时,它在我保存我的组件配置之前不起作用。
在我的例子中,我的模型正在获取项目,检查它们的参数,如果有 none,它应该在其中传递全局值。但是在保存我的组件配置之前,它不会获取它的值,因为它们还没有保存在数据库中。

  1. 如何实现安装时将默认值保存到数据库中? (组件配置->默认参数)
  2. 在模型中这样做是否合适? (更改视图模型中的参数..)

1.How 实现默认值通过安装保存到数据库? (组件配置->默认参数)

Please read it below link
https://docs.joomla.org/J2.5:Managing_Component_Updates_(Script.php)
find the string "The entire script.php file" inside the file
use the method of " function setParams($param_array) {..} " 

2.Is 这是在模型中执行此操作的正确方法吗? (更改视图模型中的参数..)

您可以使用默认值"key of value"

<field name="dbname" type="text" default="" label="Name" description="name" />