HaveFnuBB - Developper - Naming Convention
Code Indent
With KomodoEdit? :
- Prefer tab charcarters over space : [X]
- 4 number of spaces per indent
- 4 width of each Tab character
Using locales in template
I decide to avoid to make one template by language,
thus havefnubb owns one template for any language and that's all.
for example :
template/fr_FR/member.tpl will never see the light
but template/member.tpl will
So to be sharped, here are the rules to follow :
let's show the rule by an example :
{@havefnubb~member.memberlist.member.list@}
this will refer the translation in :
- the module havefnubb
- the file member.UTF-8.properties
- the translation memberlist.member.list, this translation itself is composed of two parts :
- memberlist : the template name where the object to translate is
- member.list : the label to translate
Another example :
{@havefnubb~common.logout@}
As previously, this refer to the module havefnubb and the file common.UTF-8.properties and the label logout.
As logout is too used anywhere in the application, to avoid to repeat it in any other locales files we put it in common.UTF-8.properties
so common.UTF-8.properties will contain generics/general labels
Using variables in Controllers/Zones
not ok
$user_post = '';
ok
$userPost = '';
one exception for 'id ':
ok
$id_forum = $this->param('id_forum');
template naming
to identify clearly the links between template and zone/controllers here is the convention !
- any zone template have to be named like this :
zone.foobar.tpl for example zone.category.tpl will refer to the zone category.php
- any other template have to be named like this :
controllername.function.tpl for example posts.edit.tpl will refer to the controller posts and function edit
