Override model in yii2 for mdmsoft/yii2-admin

131 Views Asked by At

I want to override the model in mdmsoft plugin of yii2. https://github.com/mdmsoft/yii2-admin

How can I do it?

1

There are 1 best solutions below

2
ِAmin On

it's a module, you have to create your own module inherent from mdm\admin\module. This link on how create a new module How to create modules in YII2

https://www.yiiframework.com/doc/guide/2.0/en/structure-modules

and in your config add the path of your config.

Original config

'admin' => [
    'class' => 'mdm\admin\Module',
    ...
]

New Config

'admin' => [
        'class' => 'new_module_name_space\Module',
        ...
    ]

You can create your model extends from yii2-amdin