关于layui提交和thinkphp数据传输的问题

浏览:989 发布日期:2020/06/12 分类:求助交流
流程:html页面点击编辑,url传输数组,后台判断是否post请求,如果否,将打开页面,并将数据传输到该页面,
问题:页面url路径有值:Request URL: http://localhost:60000/myTestProject/public/index.php?s=/web/file/file_type_edit/file_typeid/52,但后台获取为空,input("get.")试过,$_GET试过等等,求各位大佬帮忙解决下
html页面:<td value={$ft.file_typeid}>
                <a title="编辑" href="javascript:;" onclick="info_open('内容修改','{:url(\'file/file_type_edit\',[\'file_typeid\'=>$ft.file_typeid])}');"><i
                        class="layui-icon"></i></a>
            </td>
js中的函数:function info_open(title, url,width,height) {
    if (!width)    width = '20em';
    if (!height) height = '20em';
    layer.open({
        type: 2,
        area: [width,height],
        fix: false,
        isOutAnim: false,
        shadeClose: true,
        resize:false,
        shade:0.4,
        title: title,
        content: url
    });
}
php中的控制器:    public function file_type_edit()
    {
        if (!request()->isPost()) {
            $param = request()->param();
            $id=input('get.file_typeid');
            if(!empty($id)){
//                $fileType = model('file');
//                $result = $fileType->getFileTypeByid(array('file_typeid'=>$id));
                $this->assign('file_type', $id);
                return $this->fetch();
            }
            $this->assign('file_type',json_encode($param));
            return $this->fetch();
        }
        $data = input('post.');
        if (!empty($data)) {
            $fileType = model('file');
            $fileType->addFileType($data);
            ds_json_encode(10000, "修改成功");
        } else {
            ds_json_encode(10001, "修改失败");
        }
    }
最佳答案
评论( 相关
后面还有条评论,点击查看>>