Preparing the PHP Workbench

This section shows you how to set up the PHP Workbench for PHP development.

The following is assumed:

Setting Workbench Preferences

If you still see the Eclipse Welcome page, click the arrow icon to begin using Eclipse. Select the menu item Window > Preferences to open the workbench preferences.

Figure 1  PHP Preferences

  1. Select the PHP category to open the drop down menu.

  2. Select the PHP Version.

  3. In order to work with ASPs, check the Use ASP tags as PHP tags checkbox.

Editor window

The Editor window is the main area for writing and editing code. More than one Editor window can be open at the same time. The Eclipse PHP Editor enables you to work simultaneously in both PHP and HTML.

The table below describes the Editor preferences.

  1. Select each Preference type. The corresponding dialog will appear for each.

  2. Select the desired options for each type and apply. Continue until you have completed the desired configuration.

Editor Preference

Explanation

Code Assist

Code Assist provides you with a list of suggested completions for partially entered strings including PHP, HTML, classes, member variables, variables, keyword, and object code assist listings. Lists are comprised of declarations as well as most of the standard PHP and HTMLfunctions.

Code Folding

 

Code folding enables you to 'collapse' sections of a source code file while working in other parts of it. This enables you to manage larger amounts of code within one window without getting lost in a mass of complexity. A folding point is typically a method or a function but can also be an entire class or something as small as an if-then-else block or comment section. Select the elements that will be folded as default.

Hovering

When the mouse cursor is placed over a change in the vertical ruler, the hover displays the original content. You can restore the original using the ruler's context menu. Eclipse PDT supports combined Hover, Variables value, PHPDoc and source.

Syntax Coloring

A coloring feature that enables you to display text in different colors and fonts according to the specific syntax (category of term) of the term.

The Eclipse PDT Editor can color several languages at the same time and is user configurable in the Preferences window.

Task Tags

 

These are strings that indicate tasks in PHP comments. The entry marked as default will be used in the code templates.

Typing

Typing automatically closes (completes) the options selected (strings, parentheses, brackets, braces, PHPDoc and comment regions.).

 

Additional PHP Preferences are described below.

  1. Select each Preference type. The corresponding dialog will appear for each.

  2. Select the desired options for each type and apply. Continue until you have completed the desired configuration.

Other PHP Preferences

Preference

Explanation

Formatter

Used to set  formatting preferences.

Include Path Variables

Include path variables can be added to projects' include path. It can be used to define the machine-specific location of an include path.

PHP Manual

Sets URLs for accessing PHP Manuals.

Servers

Defines new PHP servers.

Templates

Sets Template preferences. Templates are shortcuts used to insert a predefined code framework that occurs frequently.