It looks like the inline_radio does not respect the selected value in case the values are ‘0’ or ‘1’. When the value is a word like ‘test ’ it is working.
See the example below.
$vars['sections'] = array(
array(
array(
'title' =>'_report_stats',
'desc' => 'PHP & EE versions will be anonymously reported to help improve the product.',
'fields' => array(
'report_stats' => array(
'type' => 'inline_radio',
'value' => '0',
'choices' => array(
'1' => 'Yes',
'0' => 'No'
)
)
)
),
)
);
// Final view variables we need to render the form
$vars += array(
'base_url' => ee('CP/URL', 'cp/addons/settings/form'), //<-- load a template with this content: <?php $this->embed('ee:_shared/form')?> and some other html
'cp_page_title' => lang('general_settings'),
'save_btn_text' => 'btn_save_settings',
'save_btn_text_working' => 'btn_saving',
'alerts_name' => GMAPS_DATA_MAP.'_settings'
);
return $this->output('form', $vars, 'settings');
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.