💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
>[danger] 获取原始数据的应用示例 + 获取器定义 ~~~ /** * 获取器 性别 * @param [type] $value [description] * @return [type] [description] */ public function getGenderAttr($value) { $status = [0 => '女', 1 => '男', 2 => '保密']; return $status[$value]; } ~~~ + 单选框的选中判断(在模板文件中经常使用) ~~~ // 模型对象 $member = self::find($id); {if $member->getData('gender') == 1} checked {/if} {if $member->getData('gender') == 0} checked {/if} <input type="radio" name="gender" value="1" {if $member->getData('gender') == 1} checked {/if}> <input type="radio" name="gender" value="0" {if $member->getData('gender') == 0} checked {/if}> ~~~ + 下拉框的选中判断 ~~~ <select name="rank"> <option value="-1" {if $data->getData('rank') == -1} selected {/if}>私有</option> <option value="0" {if $data->getData('rank') == 0} selected {/if}>待审核</option> <option value="1" {if $data->getData('rank') == 1} selected {/if}>公开浏览</option> </select> ~~~