Can I set multiple table prefixes in the yii2 framework? For example, when I set database tables, I add a prefix to different modules to facilitate module differentiation. However, in the yii2 framework, gii generates the model and uses the prefix to generate the model. How to Write the table prefix tablePrefix in yii settings? Can I set multiple table prefixes in the yii2 framework? For example, when I set database tables, I add a prefix to different modules to facilitate module differentiation. However, in the yii2 framework, gii generates the model and uses the prefix to generate the model. How to Write the table prefix tablePrefix in yii settings?
Reply content:
Can I set multiple table prefixes in the yii2 framework? For example, when I set database tables, I add a prefix to different modules to facilitate module differentiation. However, in the yii2 framework, gii generates the model and uses the prefix to generate the model. How to Write the table prefix tablePrefix in yii settings?
Yes. Table NameDf_website_article
, Where df is the prefix, website is the module, and article is the article table.
Use the ar model.
It doesn't seem to work. You can write the table name to death during the query.