Activerecord Get Full Table Name

We have db connection with [color="#808080"]tablePrefix=‘prefix_’[/color] and “A” model:

class A extends ActiveRecord {

public static function tableName() { return '{{%a}}'; }


so full table name for "A" is "prefix_a", but how to display it?

echo A::tableName(); // "{{%a}}"

One dirty solution - overwrite yii\db\Connection class or extend it and add:


     * decode table name to full name

     * @param $encodeName string encoded table name

     * @return string full table name


    public function fullTableName($encodeName) {

        return str_replace(['{','%','}'],['',$this->tablePrefix,''],$encodeName); 


then use:

echo Yii::$app->db->fullTableName( A::tableName() ); // "prefix_a"

it works… but anyone have better way?