How do you perform an if statement inside of a form_radio element with code igniter?
My goal is to get whether or not the user will allow personal messages from other members and want the correct radio button loaded. So options would be Yes (value of 0) or No (value of 1)
This is what I tried and have come up with a syntax error but I'm not even sure I'm doing it 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>