0

I am new to yii and learing generating the CRUD operation through gii first i create a country table and generate the model and controller and views using gii i am get following error Invalid Configuration – yii\base\InvalidConfigException The table does not exist: {{%country_search}}

Anil Kumar Sahu
  • 567
  • 2
  • 7
  • 27

2 Answers2

3

Add this to CountrySearch class:

    /**
     * @inheritdoc
     */
     public static function tableName()
     {
         return 'country';
     }
temirbek
  • 1,415
  • 1
  • 14
  • 27
0

Just adding to temirbek answer:

file models/Country.php

<?php

namespace app\models;

use yii\db\ActiveRecord;

class Country extends ActiveRecord
{
     public static function tableName()
     {
         return 'country';
     }

}