Php Multiselect字段未正确加载值-Magento

Php Multiselect字段未正确加载值-Magento,php,zend-framework,magento,Php,Zend Framework,Magento,我正在尝试在管理配置的multi-select字段中加载客户属性。 我确实得到了属性,但只得到了每个属性的首字母缩写,而不是全文。这是我的密码 public function toOptionArray() { $result = array(); $addressAttributes = Mage::getModel('customer/entity_address_attribute_collection'); foreach ($addressAttributes

我正在尝试在管理配置的multi-select字段中加载客户属性。 我确实得到了属性,但只得到了每个属性的首字母缩写,而不是全文。这是我的密码

public function toOptionArray()
{
  $result = array();   
  $addressAttributes = Mage::getModel('customer/entity_address_attribute_collection');    
  foreach ($addressAttributes as $addressAttribute)   
  {        
      if (($addressLabel = $addressAttribute->getFrontendLabel()))  
      $result[$addressAttribute->getId()] = $addressLabel;   
  }
 return $result;
}
这是我的system.xml代码

<fields>
    <attributes>
        <label>Attributes</label>
        <frontend_type>multiselect</frontend_type>
        <source_model>customerattributes/attributes</source_model>
        <can_be_empty>1</can_be_empty>
        <sort_order>1</sort_order>
        <show_in_default>1</show_in_default>
        <show_in_website>1</show_in_website>
        <show_in_store>1</show_in_store>                    
    </attributes>
</fields>    

属性
多选
客户属性/属性
1.
1.
1.
1.
1.

有什么想法吗

当toOptionArray()返回以下格式的数组时,源模型通常很有用:

array (
        array("label" => "First label to Display", "value" => "value1"),
        array("label" => "Second label to Display", "value" => "value2"),
);
上述内容如下:

<select ... >
    <option value="value1">First label to Display</option>
    <option value="value2">Second label to Display</option>
</select>
public function toOptionArray()
{
    $result = array();
    $addressAttributes = Mage::getModel('customer/entity_address_attribute_collection');
    foreach ($addressAttributes as $addressAttribute)
    {
      if (($addressLabel = $addressAttribute->getFrontendLabel()))
          $result[] = array('value'=>$result[$addressAttribute->getId()],'label'=>$addressLabel);
    }

    return $result;
}