PHP Mode Help
Name: | PHP Mode |
Version: | 0.2 |
Last update: | 2019-02-18 17:51:59 |
Introduction
This mode implements basic features for editing PHP files in Alpha. It
currently provides the following features:
- syntax coloring
- comments handling
- function definitions marking
- keywords completion
Electrics
PHP mode defines electric expansions for the following keywords:
if, ifelse, ifelseif, elseif,
while, do, for, foreach,
foreachkey, switch, php.
This means that you just have to type any of them and then hit the
completion key (which is by default Ctrl-Tab) and they
will expand to a complete structure which you can fill very easily: it
contains electric tabs (bullet symbols), and you can jump to the
next one using the Tab key.
For instance, typing 'do' (without the quotes)
and completing yields:
do {
•
} while (•);
Typing 'for' (without the quotes) and completing yields:
for (•; •; •) {
•
}
Typing 'switch' (without the quotes) and completing yields:
switch (•) {
case •:
•
default:
•
}
Click on this PHP Example link for an example syntax file.
Words completion
PHP mode also has language keywords completion. Type the first letters of a
keyword and Alpha will complete. If there are several choices, you'll be
prompted to choose one of them. For instance, type 'sh' (without the
quotes) and hit the completion key to get 'shuffle'.
If you type 'url' (without the quotes) and hit the completion key, a
listpick dialog is displayed with the possible choices which are in this
case: urldecode, urlencode.
File marking
All the functions defined in the document with the following signature
function foo ($arg_1, $arg_2, ..., $arg_n) {
Instructions here...
}
can be marked and made accessible using the "Marks" popup menu.
Preferences
You can set some mode-specific preferences in the PHP Mode Preferences
which you access from the Alpha ↣ Mode Setup ↣ Preferences… menu item.
Known problems
Please report any problem or bug you encounter to
Alpha's Bug Tracker.
License and Disclaimer
Copyright (c) 2001-2019, Bernard Desgraupes.
All rights reserved.
The PHP Mode package is free software and distributed under
the terms of the new BSD license:
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
- Neither the name of Bernard Desgraupes nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BERNARD DESGRAUPES BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.