larger smaller normal text version of this page

Wiki source for CodingStyle


Show raw source

[[PhplistDevelopment phplist Development]]
----
=====phplist Coding Style Guidelines=====

Please use the following guidelines when developing code for phplist.

===PHP Code===
-Use long-format code escaping: %%(php)<?php. . .?>%% (manual page: [[http://www.php.net/manual/en/language.basic-syntax.php]])
-Use ##echo## to output all data, and don't forget the semi-colon:%%(php)<?php echo $mydata; ?>%%
-Add newlines ##""(\n)""## after output lines, to help debug the output.
-When embedding variables in
-Make sure you properly quote array keys, i.e. %%(php)$array['key']%% and **NOT** %%(php)$array[key]%%
This latter syntax is [[http://www.php.net/manual/en/language.types.array.php improper code according to the manual]] (see "Array Do's and Don'ts") //and// has been broken with at least one PHP release (during 2003).

===HTML Code===
-Aim for XHTML Strict output.
-All tags and attributes in lower-case.
-Put all attribute values in double-quotes.
-Close all tags, including stand-along tags like %%(html4strict)<br />%%
-Use CSS positioning except for tabular data.
-Web browser compatibility:
-Verify all output using the W3 validator: [[http://validator.w3.org/]]
-Start testing with a Gecko-based browser (Mozilla, Firefox, ""K-Meleon"", etc) then verify with IE, Opera, Safari, etc.
-Forms:
-Include both the 'name' and 'id' attributes on all form fields.
-Include accessibility features:
-tabindex.
-label.

----
CategoryDevelopment
Page was generated in 0.2134 seconds