naming_conventions
This is an old revision of the document!
Table of Contents
Naming conventions
Objects
When refering to [object name] below, object names are always lowercase and in singular form. user not Users
File names
File type | Naming | Example |
---|---|---|
Form | [object name]_[action].frm | user_edit.frm |
Data loader | load_[object name].php | load_user.php |
Data saver | save_[object name].php | save_user.php |
Data load+save | io_[object name].php | io_user.php |
HTML
Elements
Element | Form | Example |
---|---|---|
Button | [object name]-[activity]-button | user-edit-button |
Dialog | [object name]-[activity]-dialog | user-edit-dialog |
Form | [object name]-form | user-form |
Table | [object name]-table | user-table |
Javascript
Functions
Functions should be dromedaryCase
PHP
Functions
Functions should be dromedaryCase
Class functions should be named according to what they do:
calculate | Calculates something within the object |
---|---|
can | Check if the object is able to do something |
get | Gets some information from the object |
is | Check if the object is in a given state. |
load | Retrieves object information from somewhere |
save | Stores object information somewhere |
set | Set some information in the object |
naming_conventions.1568377511.txt.gz · Last modified: 2019/09/13 12:25 by sahl