More automation, less configuration : the key is convention

Conventions are useful. Not only they allow the code to be clean and consistent, but they also allow a lot of automation.

Diem follows all symfony conventions, and adds some.


When naming something in the code ( a model, a module, a variable, a method... ), there are three ways to do it:


Lowercase, words separated by an underscore.


When use the underscore syntax ?

  • database table names
  • database field names
  • php functions ( typically helper functions )
  • array keys ( like dependency injection service parameters )


Uppercased first letter, words separated by an uppercased letter.


When use the camelized syntax ?

  • models class name


Lowercased first letter, words separated by an uppercased letter.


When use the modulized syntax ?

  • methods
  • variables
  • modules
  • templates
  • non model class names


Diem provides methods to transform a string from a syntax to another one.

dmString::underscore($string) // transform $string to underscored syntax
dmString::camelize($string)   // transform $string to camelized syntax  
dmString::modulize($string)   // transform $string to modulized syntax  

Coding standarts

The symfony coding stadarts are applied and recommended, without any addition.

Learn about symfony coding standarts

Questions and Feedback

If you need support or have a technical question, you can

  • Post to the google group
  • Come and chat on the #diem IRC channel on freenode