SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 52 | Next

James Kennard

"Mastering Joomla! 1.5 Extension and Framework Development"

Optional parameter values, signified by an equals sign, are
separated by spaces: function foo($bar0, $bar1, $bar2 = '')
Use phpDocumentor tags to comment code http://www.phpdoc.org/.
Use include_once() and require_once() in preference to include()
and require().
Use in preference to all other PHP code block delimiters.
???
??? ??? ??? ???
???
??? ??? ???
Chapter 2
[ 37 ]
phpDocumentor
phpDocumentor is a documentation tool that allows us to easily create
documentation from PHP source code. The documentation is extracted from the
source and from special comments within the source; these comments are very
similar to those used by JavaDoc.
This example demonstrates how we might document a simple function:
/**
* Adds two integers together
*
* @param int $value1 Base value
* @param int $value2 Value to add
* @return int Resultant vaue
*/
function addition($value1, $value2)
{
return ((int)$value1 + (int)$value2)
}
The multiline comment denotes a DocBlock, notice that it uses a double asterisk at
the start.


Pages:
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64