Dropdown widgets
* Select widget example
PHP Source:
<?php
class miUserDataManager extends miDataManager {
protected $_dataFields = array(
array(
'field' => 'miWebFormWidgetSelect',
'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->setOptions($options);
}
}
?>
Template:
<span>%%USERCOUNTRY%%</span>
* Select simple widget example
PHP Source:
<?php
class miUserDataManager extends miDataManager {
protected $_dataFields = array(
array(
'field' => 'miWebFormFieldSelect',
'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->setOptions($options);
}
}
?>
Template:
<span>
<select name="UserCountry">
%%USERCOUNTRY%%
</select>
</span>