Luc Hermitte (talk | contribs) m (Added to Automated_Text_Insertion Category + code reformatted) |
m (PHPdoc: Use JCommenter.vim for php-scripts moved to Automatically generate PHPdoc comments: Page moved by JohnBot to improve title) |
Revision as of 09:29, 18 October 2007
Tip: #407 - Automatically generate PHPdoc comments
Created: January 18, 2003 23:57 Complexity: intermediate Author: Klaus Horsten <email.5--AT--gmx.net> Version: 6.0 Karma: 16/4 Imported from: Tip#407
Use JCommenter.vim for php-scripts:
jcommenter.vim : A script for automatically generating JavaDoc comments
PHPdoc is an imitation of JAVAdoc.
The syntax between the two languages is very close, see the examples below:
Example 1:
You have the PHP-function:
function serialize_it($something) { $person = serialize($something); return $person; }
Put the cursor on the first line and call :call JCommentWriter()<CR>
You get:
/** * * * @param $something * @return */ function serialize_it($something) { $personen = serialize($something); return $personen; }
Example 2:
You have the PHP-class:
class submenu { ... }
Put the cursor on the first line and call :call JCommentWriter()<CR>
You get:
/** * * * @author * @version */ class submenu { ... }
Example 3:
For a class-variable you get:
/** * */ var $urls;
Note:
It does not work if you have = like in
function serialize_it($something = ) {}
But I think jscript.vim can be adapted for the use with PHP.
Klaus