User Tools

Site Tools


naming_conventions

This is an old revision of the document!


Naming conventions

Objects

When refering to [object name] below, object names are always lowercase and in singular form. user not Users

File names

File typeNamingExample
Form[object name]_[action].frmuser_edit.frm
Data loaderload_[object name].phpload_user.php
Data saversave_[object name].phpsave_user.php
Data load+saveio_[object name].phpio_user.php

HTML

Elements

ElementFormExample
Button[object name]-[activity]-buttonuser-edit-button
Dialog[object name]-[activity]-dialoguser-edit-dialog
Form[object name]-formuser-form
Table[object name]-tableuser-table

Javascript

Functions

Functions should be dromedaryCase

PHP

Functions

Functions should be dromedaryCase

Class functions should be named according to what they do:

calculateCalculates something within the object
canCheck if the object is able to do something
getGets some information from the object
isCheck if the object is in a given state.
loadRetrieves object information from somewhere
saveStores object information somewhere
setSet some information in the object
naming_conventions.1568377511.txt.gz · Last modified: 2019/09/13 12:25 by sahl

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki