Can I set multiple table prefixes in the yii2 framework?

Source: Internet
Author: User
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.