core/html_select set aria-selected Magento 1

117 Views Asked by At

I'm searching for a solution with the magento buildin way to create html select blocks, with aria-required. I can display basic attributes like the id or the class for example, but not this attribute.

Here is bellow my two essay:

my first essay:

$select = Mage::app()->getLayout()->createBlock('core/html_select');
$select->setName($name)
   ->setClass($class)
   ->setId($id);
   ->setArialRequired($ariaRequired); //doesn't work

my second essay:

$select = Mage::app()->getLayout()->createBlock('core/html_select'); 
$select->setData(array(
'name' => $name,
    'class' => $class,
    'id' => $id,
    'aria-required' => $ariaRequired //doesn't work
));

I expect the aria-required="true", but i have nothing.

1

There are 1 best solutions below

0
Paul On

Here is the solution :

->setExtraParams('aria-required=true');