samuelelonghin/yii2-string-id-activerecord

新的 Yii2 String ID ActiveRecord

1.1.0 2022-03-16 13:33 UTC

This package is not auto-updated.

Last update: 2024-09-26 23:50:54 UTC


README

全局组件

为了全局配置 ID 的长度,需要将组件添加到应用程序

// ...
'components' => [
    // altri componenti...

    'stringIdActiveRecord' => [
        'class' => samuelelonghin\db\assets\StringIdActiveRecord,
        'stringIdLenght' => function () {
                return 15;
        }
    ]
]

或以静态方式

// ...
'components' => [
    // altri componenti...

    'stringIdActiveRecord' => [
        'class' => samuelelonghin\db\assets\StringIdActiveRecord,
        'stringIdLenght' =>  15,
    ]
]