【问题标题】:Joomla get class from Form FieldJoomla 从表单字段中获取类
【发布时间】:2023-03-27 10:20:01
【问题描述】:

我有一个像这样的 Joomla 字段表单:

<field 
    name="visible"
    type="list"
    label="COM_VISIBLE"
    description="COM_VISIBLE_TOOLTIP"
    class="inputbox">
        <option value="0">COM_HIDDEN</option>
        <option value="1">COM_VISIBLE</option>
 </field>

如何获取类属性??

$field->label and $field->input it's ok... 
but with 

    JFormFieldList
    JFormFieldMedia
    JFormFieldHidden
    JFormFieldMedia  

return "Undefined property: JFormFieldList::$class in... ()"

否则为空

【问题讨论】:

  • 更新:已解决 $class= $this->form->getFieldAttribute($field->fieldname, 'class', '', $field->group);
  • 请在下方添加您的解决方案作为正确答案

标签: forms class joomla field components


【解决方案1】:

解决了

$class = $this->form->getFieldAttribute($field->fieldname, 'class', '', $field->group); – 

【讨论】:

  • 嗨!一段时间以来,Joomla 拥有自己的 StackExchange 站点:joomla.stackexchange.com。我建议你在那里问你未来的joomla 相关问题。 Joomla 大师现在主要围绕 joomla.stackexchange.com
  • 谢谢!我在 joomla.stackexchange.com 上创建了新帐户
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2013-12-28
  • 2020-05-18
  • 2011-07-11
  • 1970-01-01
  • 2012-09-20
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多