【发布时间】:2019-10-25 15:37:17
【问题描述】:
我正在寻找使用 magento 内置方式创建 html 选择块的解决方案,需要 aria。我可以显示基本属性,例如 id 或类,但不能显示此属性。
下面是我的两篇文章:
我的第一篇文章:
$select = Mage::app()->getLayout()->createBlock('core/html_select');
$select->setName($name)
->setClass($class)
->setId($id);
->setArialRequired($ariaRequired); //doesn't work
我的第二篇文章:
$select = Mage::app()->getLayout()->createBlock('core/html_select');
$select->setData(array(
'name' => $name,
'class' => $class,
'id' => $id,
'aria-required' => $ariaRequired //doesn't work
));
我期待 aria-required="true",但我什么都没有。
【问题讨论】:
-
我认为您可以使用 $class 值,例如 required-entry
标签: magento magento-1.7 magento-1.9 magento-1.8 magento-1.4