NetBeans code templates

January 16, 2012

Something I’ve only just discovered the usefulness of is code templates in Netbeans. I always used to have autocomplete set up in Outlook for common phrases like “if you have any queries, please get in touch”, and saved a lot of typing.

Having found the NetBeans templates module for quickly creating common bits of Drupal code, I started digging around in the default NetBeans options, and found that there are all sorts of little timesavers. Here are a few good ones:

  <td>
    Template
  </td>
</tr>
  <td>
    foreach($previously_assigned_variable as $value)
  </td>
</tr>

<tr>
  <td>
    forek
  </td>
  
  <td>
    foreach($previously_assigned_variable as $key => $value
  </td>
</tr>
Shortcut
fore

There is more info on the NetBeans site.