@filesource
create a syntax-highlighted cross-referenced file containing source code of the current file and link to it
Gregory Beaver
Copyright 2002, Gregory Beaver
(phpDocumentor 1.2+)
@filesource
Description
The @filesource tag can only be used in a page-level DocBlock, it will be ignored anywhere else. phpDocumentor parses the file source of the current file, and outputs syntax-highlighted source code with line numbers, links to documentation and then adds a link to the generated file in the documentation.
The @example tag serves a similar purpose, but is designed to parse and create a link to an external example file.
@filesource only works with PHP 4.3.0+ due to the use of the tokenizer extension, which was not stable prior to PHP 4.3.0. Go to http://www.php.net and download PHP 4.3.0 to use @filesource
Example
Here's an example:
- /**
- * Contains several example classes that I want to parse but I
- * also want to show the full source
- * @package mypackage
- * @subpackage example
- * @filesource
- */
- /**
- * This class does things
- * @package mypackage
- * @subpackage example
- */
- class oneofmany extends mainclass
- {
- ...