Documenting the functions available in ImpressCMS will assist other developers in using them - provide a description of what they do, what parameters are needed and what the function returns. A function's Code Documentation Block - DocBlock may have any of the standard phpDocumentor Tags plus the following tags:

  • @global
  • @param
  • @return
  • @staticvar
  • inline{@source}
Function short description Function long description * @param datatype $paramname description @param datatype1|datatype2 $paramname description @return datatype description */

@param and @return tags, when used, must not be empty. Here is an example from includes/functions.php -

Return a linked username or full name for a specific $userid * @param integer $userid uid of the related user @param bool $name true to return the fullname, false to use the username; if true and the user does not have fullname, username will be used instead @param array $users array already containing XoopsUser objects in which case we will save a query @param bool $withContact true if we want contact details to be added in the value returned (PM and email links) @return string name of user with a link on his profile */ function icms_getLinkedUnameFromId($userid, $name = false, $users = array (), $withContact = false) {

For other documentable elements, see Documenting Code Elements Category: Getting Started Category: Development Category: Documentation <[Languages |Function Code Documentation Block - DocBlock]>

Last modified on 2010/11/11 by Anonymous
The comments are owned by the poster. We aren't responsible for their content.