renzhengchi

renzhengchi

这家伙有点懒,还没写个性签名!

  • 财富值15
  • 威望值0
  • 总积分15

个人信息

  • 回复了 的回复

    我只知道插入的话可以在模型中写
    public function behaviors(){

        return [
            [
                'class' => AttributeBehavior::className(),
                'attributes' => [
                    ActiveRecord::EVENT_BEFORE_INSERT => 'name',
                ],
                'value' => function ($event) {
                    return md5($this->name);
                },
            ],
        ];
    }
    

    behaviors确实没研究过 我研究下,有结论或问题再回复你^ ^

  • 发布了话题
    Active Record 某字段数据解密
实习生 等级规则
15/20
资料完整度
10/100
用户活跃度
0/100

Ta的关注

0

Ta的粉丝

0

Ta的访客

1