Commenting Lines Blocks

Zend Studio allows you to select a location or block of text and tag it as comments.

 

There are two types of comment code that can be added or removed:

  1. Line Comments  

  2. Block Comments  

The behavior of this feature changes according to the selected area of code. PHP sections and HTML sections are treated differently. The comment added depends on the context (i.e., PHP or HTML).

 

To comment a line/block:

Go to Edit | Add/Remove Line Comment (or Ctrl+Slash).

Go to Edit | Add/Remove Block Comment (or Ctrl+Shift+Slash).

 

For PHP Sections:

Line Comments option inserts the double forward-slash characters (//) to the line or lines selected as comments:

// Comment Text Line 1

// Comment Text Line 2

// Comment Text Line 3

 

Block Comment option inserts the beginning (/*) and ending (*/) coding in order to mark the selected line or lines as comments.

/* Comment Text Line 1

Comment Text Line 2

Comment Text Line 3 */

 

For HTML Sections:

Line Comments and Block Comment options behave the same, inserting beginning (<!-- ) and ending (-->) tags to mark the selected line or lines as comments.

<!-- Comment Text Line 1

Comment Text Line 2

Comment Text Line 3 -->

 

 

Related Links

Related Links:
Editing

Using Code Completion

@var tag as Class Type Hint

Using Templates

Indenting Code

Inserting HTML Tags

Usability Shortcuts/Timesavers

Matching Highlighted Elements

Clone View

Open

Code Snippets

Printing