php - If Statements with radio buttons with CI -
how perform if statement inside of form_radio element code igniter?
my goal whether or not user allow personal messages other members , want correct radio button loaded. options yes (value of 0) or no (value of 1)
this tried , have come syntax error i'm not sure i'm doing correctly.
<div class="input"> <?php echo form_label((form_radio('pmusers', '0', if ($user_settings[0]->members_can_pm == 0))) . 'yes', 'pmusers'); ?> <?php echo form_label((form_radio('pmusers', '1')) . 'no', 'pmusers'); ?> </div>
don't check inline. also, universally, 0 = no , 1 = yes
if($user_settings[0]->members_can_pm == 1){//can pm $canpm = 1; $cantpm = 0; }else{ $canpm=0; $cantpm=1; } echo form_label((form_radio('pmusers', '0',$canpm, 'pmusers')).'yes','pmusers'); echo form_label((form_radio('pmusers', '0',$cantpm, 'pmusers')).'no','pmusers');
Comments
Post a Comment