fastadmin获取关联表数据select渲染

php

php 复制代码
	public function piliangadd(){
        if (false === $this->request->isPost()) {
            $fenlei_list = Db::name('fenlei')->order('weigh desc')->select();
            $this->assign('fenleilist',$fenlei_list);
            return $this->view->fetch();
        }
		
        $fenlei = $this->request->post('fenlei');
        Db::startTrans();
        try {


            $videourllist = explode(',',$datalist);
            foreach ($videourllist as $key => $item){

            }

            Db::commit();
            $this->success('操作成功');
        } catch (Exception $e) {
            Db::rollback();
            $this->error($e->getMessage());
        }

    }

piliangadd.html

html 复制代码
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('所属分类')}:</label>
        <div class="col-xs-12 col-sm-8">
            <select name="fenlei" class="form-control">
                {foreach name="fenleilist" item="vo"}
                <option value="{$vo.id}">{$vo.fenlei}</option>
                {/foreach}
            </select>
        </div>
    </div>
相关推荐
悠悠~飘1 天前
17.PHP基础-数组
php
Q_Q5110082851 天前
python+django/flask+vue的书城图书阅读器系统,亮点含目录章节pycharm
spring boot·python·django·flask·node.js·php
计算机科学与技术学习中1 天前
文件上传漏洞
php
emma羊羊2 天前
【PHP反序列化】css夺旗赛
开发语言·网络安全·php
Q_Q5110082852 天前
python+django/flask的图书馆管理系统vue
spring boot·python·django·flask·node.js·php
Q_Q5110082852 天前
python+django/flask的美食交流宣传系统vue
spring boot·python·pycharm·django·flask·node.js·php
m0_495562782 天前
Swift的逃逸闭包
服务器·php·swift
Elastic 中国社区官方博客2 天前
Observability:适用于 PHP 的 OpenTelemetry:EDOT PHP 加入 OpenTelemetry 项目
大数据·开发语言·人工智能·elasticsearch·搜索引擎·全文检索·php
catchadmin2 天前
用 LaraDumps 高效调试 PHP 和 Laravel
php·laravel
刘恒1234567892 天前
PHP中对于(并发/并行)相关概念
php