'{{%admin}}'
will be prefixed with the table prefix if one is set. 'admin'
will not.
I can't find a reference for this exactly but it can be inferred from the docs and source code for \yii\db\ActiveRecord::tableName()
.
Docs:
By default this method returns the class name as the table name by calling yii\helpers\Inflector::camel2id()
with prefix yii\db\Connection::$tablePrefix
. If yii\db\Connection::$tablePrefix
is 'tbl_', 'Customer' becomes 'tbl_customer', and 'OrderItem' becomes 'tbl_order_item'. You may override this method if the table is not named after this convention.
Source Code is:
public static function tableName()
{
return '{{%' . Inflector::camel2id(StringHelper::basename(get_called_class()), '_') . '}}';
}