Defines the class for the functions
info() returns a helpline on the function an its arguments
dowork($args) calculates the result. $args is an array without keys given by the template parser. As the user writes directly the arguments as template, the function should not assume all arguments are present but check the number of arguments. Each argument is a string.
Functions should not have side effects, but be self-sufficient. Functions do not know the context they are in. Sofawiki-supplied functions are in the inc/functions folder.
User supplied functions are in the site/functions folder and must be included in the configuration.php file.
- Each file in the functions folder contains one function class.
- The functions are named lowercase alphanumeric, starting with an alpha and no space.
- The filename is the function name.
- Each file contains the class definition and adds the function to the $swFunctions global array using the function name as key.