Language and development rules: Difference between revisions

Jump to navigation Jump to search
Line 272: Line 272:


= HTML norms =
= HTML norms =
== Syntax rules ==
* HTML used must be HTML compliant and not XHTML. All attributes of HTML tags must be in lower case and quoted with ".
* HTML used must be HTML compliant and not XHTML. All attributes of HTML tags must be in lower case and quoted with ".


Line 293: Line 294:


* External scripts must be written into Perl if they can't be written into PHP. Usage of another language is not forbidden but must be argue before onto development mailing-list.
* External scripts must be written into Perl if they can't be written into PHP. Usage of another language is not forbidden but must be argue before onto development mailing-list.
== External templating framework ? ==
There is ton of frameworks to provide a templating language of an HTML page. The best and faster is just called "PHP", and because Dolibarr already depends on PHP, there is no need for depend on a third languages.
All templating frameworks are just preprocessor, BEFORE PHP. It can't be faster than PHP alone. When we say "speed, when using cache of templating framework, is increase", it is in fact the overtime spent by the framework that is reduced by cache, not the speed of processing PHP file. We should says "any templating framework has an overload over PHP, the cache of framework, just reduce the slowing effect of using it", but not "the speed is increased, it is always increased".
Above all, having a templating system is completely possible by doing a "'''.tpl.php'''" file that dos not contains any logic code, but only HTML and echo. We get same result (but faster and easier to develop because it does not need to do all the setXXX) before calling each template. All variables (known by code that include the template) are automaticaly known into a PHP template page. No risk to forget a set, and a lot of line of codes reduced, a lot of time saved.
Also, keeping a 100% isolation between code and HTML output is interesting in only 1 situation: When teams building design is complety different than team building logic code, AND if you build not too sophisticated pages, AND with no need of too many Ajax features (this need to know how code works).
And this situation is surely not the Dolibarr future (team will often be same, Ajax will be more and more present, event if I hope not too much, and screens are more and more dependent of dynamic or contextual events, difficult to have with a template without transforming the template into a page with high level of code).
There is a ton of other reasons to not use an external templating system and all arguments to use a templating system are the best argument to use PHP as our templating system, so to not use them.


= Dolibarr norms and code skeleton =
= Dolibarr norms and code skeleton =

Navigation menu