Netbeans PHP Code Template List

08/10/2008

I have just tried NetBeans again. Last time I tried, it didn’t caught my intention much. May be that day, Eclipse serve me enough. But last night I tried the NetBeans again, and I quite impressed with the software.

There is code templates for PHP language, I tried to search on Internet for the code templates lists but I can’t found anything that can helped. It will really helpful if we have a cheat sheet for that.

So I listed the code templates here. Maybe someone will found it helpful.

Abbrevation

Expanded Text

cln

$$${new_obj} = clone $$${variable};

${cursor}

cls

class ${class_name} {

function ${class_name}() {

${cursor};

}

}

eco

echo(“${message}”);

${cursor}

elif

elseif (${condition}) {

${cursor};

}

els

else {

${cursor};

}

fnc

function ${function_name}() {

${cursor};

}

fore

foreach ($$${array_variable} as $$${variable}) {

${cursor};

}

forek

foreach ($$${array_variable} as $$${number_variable} => $$${variable}) {

${cursor};

}

if

if (${condition}) {

${cursor};

}

inst

if ($$${variable} instanceof ${class}) {

${cursor};

}

itdir

$$${dirh} = opendir(${dirname});

if ($$${dirh}) {

while ($$${dir_element} = readdir($$${dirh})) {

${cursor};

}

unset($$${dir_element});

closedir($$${dirh});

}

iter

for ($$${number_variable} = 0 ; $$${number_variable} < count($$${array_variable}) ; $$${number_variable}++) {

${cursor};

}

my_fa

while ($$${row} = mysql_fetch_array($$${query})) {

${cursor};

}

My_fo

while ($$${row} = mysql_fetch_object($$${query})) {

${cursor};

}

My_fr

while ($$${row} = mysql_fetch_row($$${query})) {

${cursor};

}

My_gc

ob_start();

${cursor};

$$${contents} = ob_get_contents();

ob_end_clean();

pclon

parent::__clone();

pcon

parent::__construct();

${cursor}

pr

print ${message};

${cursor}

prln

print ${message}.”\n”;

${cursor}

prs

print “${message}”;

${cursor}

prv

print(“\$$${variable} = “. $$${variable});

${cursor}

swi

switch ($$${variable}) {

case ${value}:

${cursor};

break;

default:

break;

}

while

while (${condition}) {

${cursor};

}