简体   繁体   中英

Zend Framework: Form: Should I use camelCase for form element names & DB tables, or not?

I like everything to be neat and semantic, therefore I am reaching out for some advice on a subject I am 50/50 on, I realise this is pretty much down to personal preference but want to stick to doing things one way.

Note: I know this question has been asked before, but the answers are very mixed and usually boil down to... stick to the convention being used in the application. But when creating a new application, whats the best way to do it?

The database columns look like:

description, user_id, blah_id

Therefore should my form elements look like:

Option 1: $userId = new Zend_Form_Element_Select(' user_id ');

OR

option 2: $userId = new Zend_Form_Element_Select(' userId ');

OR:

Change the (MySQL) database to include camelCase tables and columns too??

What are your thoughts on this?

Zend Framework use camelCase. So if you can change the naming of tables and column, use this.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM