Adding Comments

In this Topic Hide

About

Commenting a Line

Commenting More than One Line

Uncommenting a line/lines

Commenting a Block

About

PDT allows you to quickly and easily comment and uncomment code by selecting a line or a block of text and tagging it as a comment.

Comments can be added to single lines of code (Ctrl + /) or blocks of code (Ctrl + Shift + /).

In addition, special PHPDocBlock comments can also be added. See "Adding PHP DocBlock Comments" for more information.

The following procedures describe how to comment and uncomment lines and blocks of code.

Commenting a Line

ref_icon.png

To comment  a line:

  1. Place the cursor anywhere on the required line of code.

  2. Press Ctrl + /
    Two slashes "//" will be added to the front of the line, causing it to be recognized as a comment.

comment_line.png

 

Commenting More than One Line

ref_icon.png

To comment more than one line:

  1. Select all the lines that you would like to be commented.

  2. Press Ctrl + /
    Two slashes "//" will be added to the front of each line, causing them to be recognized as a comment.

comment_lines.png

 

 

Uncommenting a line/lines

ref_icon.png

To uncomment a line/lines:

  1. Select the required line(s).

  2. Press Ctrl + /
    The commenting formatting will be removed from the code.

 

Commenting a Block

ref_icon.png

To comment  a block:

  1. Select the required block of code.

  2. Press Ctrl + Shift + /
    The beginning (/*) and ending (*/) characters will be added in the appropriate places in order to mark the selected block as a comment.

comment_block.png

 

 

link_icon.png

Related Links:

Commenting Code

phpDoc Comments

Commenting PHP DocBlocks