Yii2 on db tables with german characters in the name

Hi!

I would like to use german characters in table names, but model generator doesn’t allow it. I can name tables with ae, it’s fine for me, but for the end users I would like to show ä if possible in an easy way. Is there a way to accomplish this anyhow?

Thanks a lot!

BR

c

You can define an attribute in your model an display that.

Or use I18N messages.

See also http://www.yiiframework.com/wiki/227/guidelines-for-good-schema-design/

Hi!

Do you mean you want to have database-tablenames with german äöü…

Is my question: Just Why? …

Its absolutley not needed to create table names in german.

(And I also think that is no good practise)…

Regards

Jeah, I would like to use them directly if possible, because than I don’t need to hassle once more with I18N, everything looks already as it’s the best for the user (who is german of course).

English singular is the way to go, since this is expected by the model generator and inflector.

Linking this one https://github.com/schmunk42/yii2-giiant/pull/94 since it’s related…

You could use the comment of a column to store "mapping" data, I did that recently in a project and it worked well.

Just make sure to cache or parse the information.