POD in PHP

inkdroid on 2003-07-31T18:43:51

I work with PHP and Perl alot during the day. I've been internally bewailing the fact that there is no POD like documentation format for PHP. At least none that comes standard, as POD and javadoc do for Perl/Java. Then I was looking closely at one of the PHP class files I was editing and noticed that someone (it had to be petdance) had done this:



/*

=head1 NAME

Page - A base class for all HTML pages.

=cut

*/

class Page {



/*

=head2 Page()

The constructor for the Page object. Pass in the args, etc, etc.

=cut

*/

function Page() { ... do PHP stuff here... }

...



So it's PHP but it has POD embedded in it within PHP multiline comments. So then you can run perldoc on the PHP file, and kazaam you get a nice POD document on the screen. I have no idea why this never occurred to me before, the solution is so simple it's pure genius :) Thanks Andy, this made my day.


Pod in non-Perl uses

TorgoX on 2003-08-01T22:10:22

I approve, and am pleased. May Pod::Simple and Pod::Perldoc ooze down happiness on all languages!