问题描述
当控制器在二级目录,一键生成crud会有两个问题出现
问题一:无法读取model路径,列表不输出
问题而:添加或编辑时无法关联数据
复现步骤
新建一个demo表,里面有id,content,createtime,updatetime,status字段。
新建一个demo_test表,里面有id,demo_id,content,createtime,updatetime,status字段。
执行命令php think crud -t demo -c demo/demo -u demo/demo
执行命令php think crud -t demo_test -c demo/test -u demo/test
把adminmodeldemoTest.php搬到 上一级,并重命名DemoTest.php,修改命名空间、类名为DemoTest,此步骤解决列表不显示问题
点击
进入adminview修改 add.html 把data-source的值修改为demo/demo/index
然后是怎么弄都不能让demo_test中的demo_id字段关联demo
BUG截图
POST http://www.demo.com/admin/demo/demo/test/index 500 (Internal Server Error)
安装启用插件列表
FastAdmin版本
1.0.0.20180911_beta
运行方式 apache2handler
调试模式 否
环境信息 Apache/2.4.6 (CentOS) PHP/5.6.33
上传模式 local
上传URL ajax/upload
PHP版本
PHP 5.6.33
运行环境
Apache 2.4
最后于 4月前
被lgc137编辑