larger smaller normal text version of this page
phplist Development

phplist Coding Style Guidelines


Please use the following guidelines when developing code for phplist.

PHP Code

  • Use long-format code escaping:
    <?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 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.
    $array['key']
    and NOT
    $array[key]
This latter syntax is 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
      <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.0980 seconds