当前位置:网站首页>Fastadmin background setting radio button
Fastadmin background setting radio button
2022-06-29 20:08:00 【Pretty boy who doesn't want to give his name】
First, put the screenshot of the database field

Go straight to the code
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>There is a point to be noted above Namely foreach Internal name In the field
It needs to be in the corresponding controller _initialize() Add the following code inside
$this->view->assign("shopList", $this->model->getShopList());However, in the corresponding model (model) Add the corresponding method in
public function getShopList()
{
return ['1' => __('Shop 1'), '2' => __('Shop 2')];
}边栏推荐
- There are more than 20 databases in a MySQL with 3306 ports. How can I backup more than 20 databases with one click and do system backup to prevent data from being deleted by mistake?
- freemarker模板框架生成图片
- 使用Gunicorn部署web.py应用
- 畫虎國手孟祥順數字藏品限量發售,隨贈虎年茅臺
- mapbox-gl开发教程(十二):加载面图层数据
- Spark存储体系底层架构剖析-Spark商业环境实战
- Union find
- Flume配置3——拦截器过滤
- Configuration du Flume 4 - source personnalisée + sink
- 【译】十二因子应用(四)
猜你喜欢

Performance improvement at the cost of other components is not good

Flume配置4——自定義Source+Sink

Flume理论

File contains vulnerability

Understanding of software test logic coverage

画虎国手孟祥顺数字藏品限量发售,随赠虎年茅台

Lock4j -- distributed lock Middleware -- customize the logic of lock acquisition failure

As the "only" privacy computing provider, insight technology is the "first" to settle in the Yangtze River Delta data element circulation service platform

Tiger painter mengxiangshun's digital collection is on sale in limited quantities and comes with Maotai in the year of the tiger

La collection numérique Meng xiangshun, artiste national du tigre peint, est disponible en quantité limitée et est offerte avec Maotai de l'année du tigre
随机推荐
Real time tracking of bug handling progress of the project through metersphere and dataease
Spark存储体系底层架构剖析-Spark商业环境实战
SSH command and instructions
npm ERR! fatal: early EOF npm ERR! fatal: index-pack failed
Zotero期刊自動匹配更新影響因子
A keepalived high availability accident made me learn it again!
2022年深圳市福田区支持先进制造业发展若干措施
[network orientation training] - Enterprise Park Network Design - [had done]
Oracle保留字查询
Nacos problem
3-2 host discovery - layer 3 discovery
A great open source image watermarking solution
Flume理论
【精品】pinia详解
Application of twelve factors (4)
Foxit software was invited to appear at the 2022 advanced manufacturing digital intelligence development forum
【译】十二因子应用(四)
Flume配置4——自定义Source+Sink
Understanding of software test logic coverage
PowerShell command outputs only a list of directories