您的位置:首页 > 其它

October 大坑小坑

2016-09-20 18:27 218 查看
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:数据库名字一定和现实的函数名不相同
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: