A
A
agent11562016-11-28 15:02:00
Yii
agent1156, 2016-11-28 15:02:00

What do double curly braces mean in yii2 migrations?

{{% users }} What does this mean? Why do you need curly brackets and the % sign

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander Urich, 2016-11-28
@Urichalex

The curly braces are replaced with the table name highlight characters. For example, in mysql it is a ` symbol
, that is, {{user}} will go into the query as `user`
The percent sign is replaced by the table prefix if it was set in the database connection config.
For example,
'tablePrefix' => 'qwe_' is specified in the config,
then {{%user}} will get into the request as `qwe_user`

R
Ramm, 2016-11-28
@rammtw

https://yiiframework.com.ua/ru/doc/guide/2/db-dao/...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question