Home >Backend Development >PHP Tutorial >Some notes on CI framework
Use the data obtained from the database when entering the View layer to determine whether the select is displayed to achieve the default selection goal
<select name="data[stat]"> <option value="0" <?php if(isset($data['stat']) && $data['stat'] == 0 && $data['stat'] != '') : echo 'selected="selected"'; endif;?>>下线</option> <option value="1" <?php if(isset($data['stat']) && $data['stat'] == 1 && $data['stat'] != '') : echo 'selected="selected"'; endif;?>>正常</option> <option value="2" <?php if(isset($data['stat']) && $data['stat'] == 2 && $data['stat'] != '') : echo 'selected="selected"'; endif;?>>删除</option> </select>
The above introduces some notes on the CI framework, including aspects of the content. I hope it will be helpful to friends who are interested in PHP tutorials.