Editing PHP Code
WeBuilder includes special features and tools that help to write and edit PHP code more efficiently.
Writing PHP code
Tools on the PHP menu and toolbar allow you to insert instant pieces of PHP code. Auto Complete helps to remember and quickly insert variable names. Function hints allow to lookup function parameters without looking in the documentation.
PHP menu and toolbar
PHP menu and toolbar allows to quickly insert common PHP code fragments and provides access to some PHP related tools.
PHP Snippets provides a drop-down menu for inserting common PHP structures. To edit this menu, click Edit PHP Snippets.
PHP Server Variables displays a list of server variables. To insert an item, select it and click OK.
PHP Tag inserts PHP tags <? ?>.
PHP Block inserts PHP tags <? and ?> in separate lines, creating multi-line PHP code block.
PHP Output Tag inserts PHP output tag <?= ?>.
Include File inserts file include directive.
Require File inserts file require directive.
Comment Block inserts empty PHP comment block /* */ or converts the selected text to comment block.
Line Comment inserts PHP single line comment // or converts the selected text to comment lines.
Convert HTML to PHP converts selected HTML code to pure PHP code that outputs HTML.
Syntax Check validates current PHP document against syntax errors.
Language Browser: Language Browser provides convenient way for working with PHP objects.
Using PHP function hints
Function hints allow to lookup known PHP function parameters and description without looking in the documentation.
Function hints are displayed when you type ( after a PHP function name.

Alternatively you can place caret inside the braces of a PHP function call and press Shift+Ctrl+Space to open hint on demand.

Using Auto Complete
Auto Complete allows to reduce the amount of typing, by displaying list of valid function names that can be inserted with a mouse double click or Enter key.
Auto Complete window can be displayed by pressing Ctrl+Space. You can also set up Auto Complete to appear automatically.
Notes
- Auto Complete options can be changed via Preferences dialog window.
- Auto Complete popup delay time can be customized via Preferences dialog window.
- To close Auto Complete popup, press Esc.
Using Code Explorer
Code Explorer lists classes, functions, variables and includes contained in the script and allows you to quickly move to any of them. You can navigate to an item by clicking it.
To enable Code Explorer, on the View menu, click Code Explorer. Make sure that the PHP option is enabled at the bottom of the Code Explorer pane.
Code Explorer refreshes automatically when you move your mouse over it, but you can also refresh it manually at any time by clicking Refresh button.
Note
- By default, PHP variables are not listed in Code Explorer. To list variables, on the Code Explorer toolbar, click Options and then enable option List Variables.
Syntax Check PHP file
Syntax Check feature validates your PHP script against syntax (parse) errors.
To perform a syntax check
- On the PHP menu, click Syntax Check.
Notes
- You can also click Syntax Check on the PHP toolbar.
- To use this feature, PHP must be installed on your computer. You must specify path to php.exe file in the Preferences window, which is accessible via Options menu.
Debugging PHP scripts
If you are familiar with code debugging, the built-in PHP debugging features might be helpful to you. For PHP debugging features to work, you must have PHP installed on your computer and you must also have xDebug extension added to your PHP setup.
Debugger Settings window: NDebugger Settings window allows you to configure the PHP debugger.
General
- Output: Indicates how the output from the executed PHP script needs to be handled.
- Parameters: Specifies the URI parameters to be passed to the PHP script. Example: id=1&action=edit Debugger Connection
Session name:
- Debug session name. It is recommended not to modify the default value.
- Listen to port: Indicates the TCP port number WeBuilder listens to for xDebug connections. If you want xDebug to communicate with WeBuilder through some other port, you can change this value, but you have to change the corresponding xDebug configuration value in the php.ini file as well.
|