PHP Code Inserts

EditRocket provides PHP code inserts, or snippets, via the Inserts - PHP menu option. Code inserts are also included as a tab on the PHP sidekick. The keyboard shortcut of ctrl or cmd + shift + i launched the code insert popup window.

The following types of code inserts are available for PHP:

Statements - This includes if, else, elseif, and if else statements and also includes switch and case statements.

Loops - This includes do while, for, foreach, and while

General Inserts - function, php script tags, etc.

Globals - COOKIE, ENV, FILES, GET, GLOBALS, POST, REQUEST, SERVER, and SESSION

HTML Inserts - includes HTML doc types and tags such as body, div, form, etc.

Selecting an insert with insert the text associated to the insert into the current position of the active editor. For example, selecting the PHP SESSION insert will insert the following:

$_SESSION['variable']

The "variable" piece of the inserted text will be highlighted allowing the user to type in a variable name without having to click or highlight text.

PHP inserts can be modified, or custom PHP inserts can be created using the Insert - Edit Insert and Insert - Add Insert options.