(phpDocumentor 1.1+ )
inline {@source} -- display source code of a function or method in the long descriptionThe {@source} inline tag is used in front of functions
The inline {@source} differs from all ordinary tags. Inline tags parse and display their output directly in the documentation. In other words, this DocBlock:
/** * Text with a normal tag, @copyright * @copyright Copyright 2002, Greg Beaver */ function element() { } |
Parses as:
elementelement ( ) Text with a normal tag, @copyright
|
/** * Text with an inline source tag: * {@source} * displays without a break in the flow */ function element($pages) { if (empty($pages)) { die("<b>ERROR</b>: nothing parsed"); } } |
Parses as:
elementvoid element ( $pages ) Text with an inline source tag:displays without a break in the flowfunction element($pages) { if (empty($pages)) { die("ERROR: nothing parsed"); } }
|
The {@source tag has two optional parameters, the starting line number to display and the ending line number to display. If only the first parameter is present, {@source} will print the source code starting on that line number to the end of the function source code. If both parameters are present, {@source} will print an excerpt of the source code beginning on the starting line number, and concluding with the ending line number.
/** * Text with an inline source tag: * {@source 3} * displays without a break in the flow */ function element($pages) { if (empty($pages)) { die("<b>ERROR</b>: nothing parsed"); } foreach($test as $hello) { echo "I love $hello"; } |
Parses as:
elementvoid element ( $pages ) Text with an inline source tag:displays without a break in the flow{ die("ERROR: nothing parsed"); } foreach($test as $hello) { echo "I love $hello"; } }
|
/** * Text with an inline source tag: * {@source 3 6} * displays without a break in the flow */ function element($pages) { if (empty($pages)) { die("<b>ERROR</b>: nothing parsed"); } foreach($test as $hello) { echo "I love $hello"; } |
Parses as:
elementvoid element ( $pages ) Text with an inline source tag:if (empty($pages)) { die("ERROR: nothing parsed"); }displays without a break in the flow
|
Prev | Home | Next |
inline {@inheritdoc} | Up | Templates |
Tag Documentation written by Gregory Beaver <cellog@users.sourceforge.net>
Copyright © 2002, Gregory Beaver