Skip to content

Instantly share code, notes, and snippets.

@xeoncross
Created September 9, 2010 19:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xeoncross/572415 to your computer and use it in GitHub Desktop.
Save xeoncross/572415 to your computer and use it in GitHub Desktop.
[PHP]
# Geany snippet config
# Little php snippets written by Atanas Beloborodov <nasko@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%()%block%
protected=protected function %cursor%()%block%
private=private function %cursor%()%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%');e%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment