October 细微的知识点和大坑小坑
1、有关需要进行October backend限制验证的:
必须在Model中使用:
use \October\Rain\Database\Traits\Validation;
2、有关需要使用October 牛逼的排序的时候:
一定不要忘记使用:
use \October\Rain\Database\Traits\NestedTree;
3、(1)fields.yaml 关联课程显示使用:
level:
label: 阶段分类
type: relation
nameFrom: name
span: left
category:
label: 课程分类
type: relation
nameFrom: name
span: left
关联关系需要使用getCategoryOptions()
Tips:数据库名字一定和现实的函数名不相同
(2)columns.yaml 展示先关关联关系的时候
category:
label: 分类
relation: category
select: name
searchable: true
关联关系需要使用getCategoryAttribute()
Tips:数据库名字一定和现实的函数名不相同