Coding conventions/naming conventions
DB Rules
| Database character code | UTF-8 (utf8mb4) |
| Collation order | utf8mb4_general_ci |
| column name | type (e.g. of machine, goods, etc.) |
|---|---|
| id | AUTO_INCREMENT |
| created_at | datetime type (creation date and time) |
| updated_at | datetime type (date and time of update) |
| deleted_at | datetime type (date and time of deletion) |
| delete_flg | integer type / initial value is 0 (delete flag) |
※Do not use null as much as possible
・Comments must be entered on the label
・Comment, enter corresponding value if normalization is done
| column name | Comment |
|---|---|
| fast_name | 姓 |
| last_name | 名 |
| birthday | 誕生日 |
| gender | [0:男性 1:女性] |
Column name”, “form name” and “php variable” must be the same.
If the column name is “enable_flg”, the form name should also be “enable_flg”.
naming rule
Controller name: 1 word + what you want to do (max 2 words excluding controller)
Capitalize the first letter of the word (Lower CamelCase)
View name: Files with the same meaning should be lined up in a row.
Put an underscore (_) between words. (Snake case)
Method name of controller
The method name of the controller: “action_●●” should be Lower CamelCase.
Put conjunctions in “master table”, “sub-tables”, and “definition table”.
Put an underscore (_) between words. (Snake case)
Example)Sub table: sub_claim,sub_payment…etc.
Example)Definition table: def_status,def…etc
Column names should have an underscore (_) between words. (Snake case)
Capitalize words and join them with underscores (_).