This section shows you how to set up the PHP Workbench for PHP development.
The following is assumed:
You are starting with a new workbench installation with default settings.
You are familiar with the basic workbench mechanisms, such as views and perspectives.
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
Select the PHP category to open the drop down menu.
Select the PHP Version.
In order to work with ASPs, check the
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.
Select each Preference type. The corresponding dialog will appear for each.
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 completion 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 PHP IDE 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 PHP IDE 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.
Select each Preference type. The corresponding dialog will appear for each.
Select the desired options for each type and apply. Continue until you have completed the desired configuration.
|
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. |