Radio group widgets
* Radio group widget example
PHP Source:
<?php
class miUserDataManager extends miDataManager {
protected $_dataFields = array(
array(
'field' => 'miWebFormWidgetRadio',
'data' => 'UserCountry'
)
);
public function initWebForm(miWebForm $form)
{
parent::initWebForm($form);
$options = array(
1 => 'United States',
2 => 'United Kingdom',
3 => 'Germany'
);
$field = $form->getFieldObj('UserCountry');
$field->setRadioButtons($options);
}
}
?>
Template:
<span>%%USERCOUNTRY%%</span>
* Radio group simple widget example
PHP Source:
<?php
class miUserDataManager extends miDataManager {
protected $_dataFields = array(
array(
'field' => 'miWebFormFieldRadio',
'data' => 'UserCountry'
)
);
public function initWebForm(miWebForm $form)
{
parent::initWebForm($form);
$options = array(
1 => 'United States',
2 => 'United Kingdom',
3 => 'Germany'
);
$field = $form->getFieldObj('UserCountry');
$field->setRadioButtons($options);
}
}
?>
Template:
<span>
<input type="radio" value="1" name="UserCountry" %%USERCOUNTRY_0%% /> United States
<input type="radio" value="2" name="UserCountry" %%USERCOUNTRY_1%% /> United Kingdom
<input type="radio" value="3" name="UserCountry" %%USERCOUNTRY_3%% /> Germany
</span>