Notice: Undefined offset: 8192 in /home/miphpf/domains/miphpf.com/public_html/includes/common.inc on line 499

Notice: Undefined offset: 8192 in /home/miphpf/domains/miphpf.com/public_html/includes/common.inc on line 506

Warning: Incorrect key file for table './miphpf_miphpfcom/watchdog.MYI'; try to repair it query: INSERT INTO watchdog (uid, type, message, severity, link, location, referer, hostname, timestamp) VALUES (0, 'php', 'preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/miphpf/domains/miphpf.com/public_html/includes/unicode.inc on line 291.', 2, '', 'http://www.miphpf.com/manual/radio_widgets.html', '', '52.14.75.161', 1734781940) in /home/miphpf/domains/miphpf.com/public_html/includes/database.mysql.inc on line 121
Radio group widgets | MIPHPF - Your Open Source RAD PHP Framework
Skip navigation.
Home

Radio group widgets

: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/miphpf/domains/miphpf.com/public_html/includes/unicode.inc on line 291.

* 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>