You put it in the config file, along with other db configuration, like this:
'db'=>array(
'connectionString' => 'xxxxx',
'username' => 'xxxxx',
'password' => 'xxxxx',
'tablePrefix' => 'tbl_',
),
All public properties of any component can be set in the config file this way.
You may change model class name
AbcTest to User. And check Use Table Prefix. Giigenerate correct model like that:class Test extends \yii\db\ActiveRecord
{
/**
* @inheritdoc
*/
public static function tableName()
{
return '{{%user}}';
}
...
}
In
user method return '{{%user}}' if you check Use Table Prefix. If you not check Use Table Prefix in this method return 'tbl_user'.
yii2 table prefix
No comments:
Post a Comment