Standards for moodle

Standards for moodle

by Peter Bazira -
Number of replies: 1

like the "moodle newbie" i am i have to ask a few questions before i plunge headlong into the deep wink.gif

  1. Are there any agreed upon coding standards for moodle (php, html, xhtml)?
  2. What about using php templating (smarty, patTemplate, PEAR) to separate the design from the progam logic?
  3. Would it be easier to use the PEAR resource in some parts of moodle (except the database abstraction of coursebiggrin.gif)?

I know that moodle 2.0 is envisaged to run on xml/xslt but i still feel we are a long way away from realising this unless we have predefined coding standards.

 

 

Average of ratings: -
In reply to Peter Bazira

Re: Standards for moodle

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Just before you plunge headlong into coding something it might pay to mention your plans here or check the bugs database thoroughly in case someone's working on it already or there's an easier way of doing it.

1. Someday I will get to writing a coding guide. The internal API is still evolving and some rewrites are coming up this year. Basically, you should look at similar code to get a feel for how different things are performed and formatted.

2. Yes, in fact Smarty is a contending alternative to XSLT. See http://moodle.org/mod/forum/discuss.php?d=957&parent=3817

3. There might be a few small parts that could use PEAR, but I don't get the impression PEAR is really mature enough yet to rely on for every installation .. the less outside dependencies Moodle has the more likely it can run in different PHP environments.