当前位置:网站首页>fastadmin后台设置单选按钮
fastadmin后台设置单选按钮
2022-06-29 20:05:00 【不愿透漏姓名的靓仔】
首先放上数据库字段截图

直接上代码
add:
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Shop')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="radio">
{foreach name="shopList" item="vo"}
<label for="row[shop]-{$key}"><input id="row[shop]-{$key}" name="row[shop]" type="radio" value="{$key}" {in name="key" value="2"}checked{/in} /> {$vo}</label>
{/foreach}
</div>
</div>
</div>edit:
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Shop')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="radio">
{foreach name="shopList" item="vo"}
<label for="row[shop]-{$key}"><input id="row[shop]-{$key}" name="row[shop]" type="radio" value="{$key}" {in name="key" value="$row.status"}checked{/in} /> {$vo}</label>
{/foreach}
</div>
</div>
</div>上边要注意一个点 就是foreach内的name中的字段
需要在对应的控制器内_initialize()内加上下面的代码
$this->view->assign("shopList", $this->model->getShopList());然在对应的模型(model)中加上对应的方法
public function getShopList()
{
return ['1' => __('Shop 1'), '2' => __('Shop 2')];
}边栏推荐
- How to set a pod to run on a specified node
- 【编译原理】语法分析
- 日本樱桃一颗拍出1980元天价,网友:吃了有上当的感觉
- NLP - giza++ implements word alignment
- 剑指 Offer 66. 构建乘积数组
- 一个mysql里有3306端口下,一个mysql有20多个数据库,怎么一键备份20多个数据库,做系统备份,防止数据误删除?
- [network orientation training] - Enterprise Park Network Design - [had done]
- 【剑指Offer】51. 数组中的逆序对
- Oracle11.2.0.4-rac cluster hang analysis record
- data link layer
猜你喜欢

Detailed description of gaussdb (DWS) complex and diverse resource load management methods

idea中方法上没有小绿色三角

ETCD数据库源码分析——服务端PUT流程

Linux Installation mysql8

A keepalived high availability accident made me learn it again!

Finally, Amazon~

一个超赞的开源的图片去水印解决方案
![[USB flash disk test] in order to transfer the data at the bottom of the pressure box, I bought a 2T USB flash disk, and the test result is only 47g~](/img/c3/e0637385d35943f1914477bb9f2b54.png)
[USB flash disk test] in order to transfer the data at the bottom of the pressure box, I bought a 2T USB flash disk, and the test result is only 47g~

【编译原理】语义分析

The list of winners in the classic Smurfs of childhood: bluedad's digital collection was announced
随机推荐
There is no small green triangle on the method in idea
Common knowledge of ECS security settings
Several policies of Shenzhen Futian District to support investment attraction in 2022
How to set a pod to run on a specified node
PHP implementation extracts non repeated integers (programming topics can be the fastest familiar functions)
Snowflake ID, distributed unique ID
【译】十二因子应用(四)
【网络方向实训】-企业园区网络设计-【Had Done】
Dynamics crm: among locally deployed servers, sandbox, unzip, VSS, asynchronous and monitor services
NLP - GIZA++ 实现词对齐
Sword finger offer 66 Building a product array
网站压力测试工具——Webbench
Golang基础学习
Nutch2.1 distributed fetching
Flume configuration 2 - ganglia for monitoring
Following the crowd hurts you
从众伤害的是自己
ASP.Net Core创建Razor页面上传多个文件(缓冲方式)(续)
剑指 Offer 59 - II. 队列的最大值
WPS and Excelle