set_select()辅助函数不起作用

Joe*_*mes 3 html php select codeigniter

我使用了如下代码,

<select class="form-control selection" name="currency">
                        <option value="">select currency</option>
                            <option value="AED"<?php echo set_select('currency', 'AED'); ?> >AED</option>
                            <option value="SAR"<?php echo set_select('currency', 'SAR'); ?> >SAR</option>
                            <option value="MAD"<?php echo set_select('currency', 'MAD'); ?> >MAD</option>
                            <option value="TRY"<?php echo set_select('currency', 'TRY'); ?> >TRY</option>
                        </select>
Run Code Online (Sandbox Code Playgroud)

但不幸的是,在表单验证失败后,它没有显示选定的值.为什么这个基本的set_select()方法不起作用?我已经在其他一些领域使用过这一切,而且一切正常

Kum*_*r V 8

使用前set_value(),set_select(),set_checkbox(),set_radio(),你必须通过这些字段验证即使不需要/验证.