[Geany-devel] PHP snippets

Atanas Beloborodov nasko at xxxxx
Wed Oct 22 09:01:41 UTC 2008

Hi, today i written some php snippets...I hope you use and like it.
Have a nice day ;)
Ragards, Atanas Beloborodov
Bulgarian programming portal - http://cod3r.org/
-------------- next part --------------
# Geany's snippets configuration file
# use \n or %newline% for a new line (it will be replaced by the used EOL char(s) - LF, CR/LF, CR)
# use \t ot %ws% for an indentation step, if using only spaces for indentation only spaces will be used
# use \s to force whitespace at beginning or end of a value ('key= value' won't work, use 'key=\svalue')
# use %cursor% to define where the cursor should be placed after completion
# use %key% for all keys defined in the [Special] section
# you can define a section for each supported filetype to overwrite default settings, the section
# name must match exactly the internal filetype name, run 'geany --ft-names' for a full list
# Additionally, you can use most of the template wildcards like {developer} or {date} in the snippets.
# See the documentation for details.

# filetype names:
# ASM, C, C++, C#, CAML, D, Fortran, FreeBasic, Haskell, Haxe, Java, Pascal, VHDL, Ferite, Javascript,
# Lua, Make, O-Matrix, Perl, PHP, Python, Ruby, Sh, Tcl, CSS, Docbook, HTML, XML, Conf, Diff, LaTeX,
# reStructuredText, SQL, None

# Default is used for all filetypes and keys can be overwritten by [filetype] sections
if=if (%cursor%)%brace_open%\n%brace_close%
#for=for (i = 0; i < %cursor%; i++)%brace_open%\n%brace_close%
#while=while (%cursor%)%brace_open%\n%brace_close%
do=do%brace_open%%cursor%\n%brace_close% while ()
switch=switch (%cursor%)%brace_open%case : break;\n%ws%default: \n%brace_close%
try=try%block_cursor%catch ()%block%

# special keys to be used in other snippets, cannot be used "standalone"
# can be used by %key%, e.g. %brace_open%
# nesting of special keys is not supported (e.g. brace_open=\n{\n%brace_close% won't work)
# key "wordchars" is very special, it defines the word delimiting characters when looking for
# a word to auto complete, leave commented to use the default wordchars

for=for (int i = 0; i < %cursor%; i++)%brace_open%\n%brace_close%

for=for (int i = 0; i < %cursor%; i++)%brace_open%\n%brace_close%

# Little php snippets written by Atanas Beloborodov <nasko at cod3r.org>
#Some php5 object`s usefull snippets
class=class %cursor% \n{\n\tpublic function __construct()\n\t{\t\n\n\t}\n\n\tpublic function __destruct()\n\t{\t\n\n\t}\n}
interface=interface %cursor% %block%
static=public static function %cursor%() %block%
public=public function %cursor%()\n%block%
protected=protected function %cursor%()\n%block%
private=private function %coursor%()\n%block%
#Control structures :
for=for ($i = 0; $i < %cursor%; $i++ %block%
while=while (%cursor%) %block%
if=if (%cursor%) %block%
switch=switch (%cursor%) {\n\tcase '';\n\n\tbreak;\n\n\tdefault :\n\n\tbreak;\n}\n
else=if (%cursor%) %block%else %block%
elseif=if (%cursor%) {\n\t\n}\nelseif () {\n\t\n}\nelse {\n\t\n}\n
do=do %block%while (%cursor%);
foreach=foreach (%cursor%) %block%
# Include methods
# Note : require and include is not functions ! Not required braces () 
req=require "%cursor%";
reqo=require_once "%cursor%";
inc=include "%cursor%";
inco=include_once "%cursor%";
# Others :
function=function %cursor%() %block%
def=define ('%cursor%','');
throw=throw new Exception ('%cursor%');

for=for i in xrange(%cursor%):\n\t


More information about the Devel mailing list