Skip to content

Coding guidelines

Olivier Paroz edited this page Jul 27, 2015 · 10 revisions

In General

Make it easier to review

Translations

Concatenated string cannot be processed by the l10n tools

Wrong

t('gallery',"This is my very long" +
" string, that I want to split");

Correct

t('gallery',"This is my very long string, that I want to split");

Tips

PHP uses a short-circuit evaluation technique when looking at conditions

if (conditionA && conditionB)

If conditionA is false, conditionB will never be tested.