问题:页面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, "修改失败");
}
} 最佳答案