Home > Open Source > Netbeans PHP Code Template List

Netbeans PHP Code Template List

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};

}

  1. 15/10/2008 at 12:01 pm

    nice template for autocompetion . .
    thanks . .

  2. 14/10/2009 at 9:57 pm

    Nice blog mate, that list was very handy to print and pin up on my desk for a quick shortcut glance!

    Thanks

  3. alvarocorp
    14/06/2011 at 11:45 pm

    Thanks!!!

  4. Bruno Batista
    29/06/2012 at 12:59 am

    How to code template variables transform uppercase|lowercase?

    I need to convert same variables to uppercase|lowercase|captalize.

    /**
    * @package ${1 default=”Hello”}
    * @subpackage ${com}_${1 capitalize=false}
    * @copyright Copyright (C) 2012 ${AtomTech}, Inc. All rights reserved.
    * @license GNU General Public License version 2 or later; see LICENSE.txt
    */

    // No direct access
    defined(‘_JEXEC’) or die;

    How can I do this?

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: