error create model in CRUD generator gii yii2 framework

690 views Asked by At

I have created a model class using Model generator Gii with namespace common\models\Artikel and there is no error but when I'm trying to create a model class using CRUD generator Gii, there is a error like this:

enter image description here

In my Models folder there is folder again named Artikel and then on artikel.php have that namespace common\models\Artikel. But I don't know why I get this error using CRUD generator.

1

There are 1 answers

1
rob006 On BEST ANSWER

Declaration of this class should be in common/models/Artikel.php and inside of it you should have:

namespace common\models;

class Artikel extends \yii\db\ActiveRecord {
    // ...
}

Artikel Should not be part of the namespace, it is class name.