m (Category: PHP) |
Luc Hermitte (talk | contribs) m (Added to Automated_Text_Insertion Category + code reformatted) |
||
Line 11: | Line 11: | ||
Use JCommenter.vim for php-scripts: |
Use JCommenter.vim for php-scripts: |
||
⚫ | |||
− | |||
− | |||
⚫ | |||
− | |||
− | http://vim.sourceforge.net/script.php?script_id=20 |
||
− | |||
− | |||
PHPdoc is an imitation of JAVAdoc. |
PHPdoc is an imitation of JAVAdoc. |
||
− | The syntax between the two languages is very close, |
+ | The syntax between the two languages is very close, see the examples below: |
⚫ | |||
− | see the examples below: |
||
− | |||
− | |||
− | |||
⚫ | |||
You have the PHP-function: |
You have the PHP-function: |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
− | |||
⚫ | |||
− | |||
− | |||
− | |||
⚫ | |||
− | |||
− | |||
− | |||
⚫ | |||
− | |||
⚫ | |||
− | |||
⚫ | |||
− | |||
⚫ | |||
− | |||
⚫ | |||
− | |||
⚫ | |||
− | |||
⚫ | |||
− | |||
⚫ | |||
− | |||
⚫ | |||
− | |||
⚫ | |||
− | |||
⚫ | |||
− | |||
− | |||
− | |||
⚫ | |||
You have the PHP-class: |
You have the PHP-class: |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
− | |||
− | |||
− | |||
⚫ | |||
− | |||
− | |||
− | |||
⚫ | |||
− | |||
⚫ | |||
− | |||
⚫ | |||
− | |||
⚫ | |||
− | |||
⚫ | |||
− | |||
⚫ | |||
− | |||
⚫ | |||
− | |||
⚫ | |||
− | |||
⚫ | |||
− | |||
⚫ | |||
− | |||
− | |||
− | |||
⚫ | |||
For a class-variable you get: |
For a class-variable you get: |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
− | |||
⚫ | |||
− | |||
⚫ | |||
− | |||
⚫ | |||
− | |||
− | |||
− | |||
⚫ | |||
− | |||
It does not work if you have = '' like in |
It does not work if you have = '' like in |
||
⚫ | |||
− | |||
⚫ | |||
− | |||
− | |||
But I think jscript.vim can be adapted for the use with PHP. |
But I think jscript.vim can be adapted for the use with PHP. |
||
− | |||
− | |||
Klaus |
Klaus |
||
Line 139: | Line 79: | ||
<!-- parsed by vimtips.py in 0.629234 seconds--> |
<!-- parsed by vimtips.py in 0.629234 seconds--> |
||
[[Category:PHP]] |
[[Category:PHP]] |
||
+ | [[Category:Automated_Text_Insertion]] |
Revision as of 18:50, 23 July 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