blog’s amazing Rotating Header Image

Smarty support in NetBeans || die()?

It seems that Sun is serious about providing PHP support in the NetBeans, a 10-years-old Java IDE.

However, besides many of the cool features already included there’s a showstopping shortage for many PHP devheads: NetBeans does not support the all-time favourite Smarty template library, which provides the foundations for zillions of web sites out in the cloud.

Though NetBeans does cool source highlighting and much more even when there’s PHP and HTML mixed together in a single file, Smarty support is entirely missing – I’m sure it will make many developers turn away from NetBeans in the first round, unless the support arrives soon.

As a comment says in the NetBeans issue tracker, “Officially there will not be any framework supported in NB 6.5“.

I agree that adding a framework means much more work than adding a syntax highlighter from the NB viewpoint (that’s why a separate plugin project has been established for Drupal), though even such a support could help a lot in the first round.

Fortunately we’re not entirely lost – there are two things you can do:

  • first, you can add your Smarty extension (eg. tpl) under
    Tools > Options > Miscellaneous > Files
    and set the MIME type to
    PHP files (text/x-php5)
    This step adds at least basic HTML and PHP formatting – it seems to be the most you can achieve right now.
  • and vote to the appropriate issue in the bug tracker of NetBeans right now! You’ll need to do a short one-minute registration for that, but if you’re devoted to using both Smarty and NetBeans that’s not that much.
Bookmark and Share


  1. emceha says:

    Big thanks for tip with .tpl extension!

  2. Hung Bui says:

    You can try to use Eclipse IDE.. There is a plugin for Smarty Template

  3. Mike says:

    Nice! this was really helpful!

  4. SeanJA says:

    We shouldn’t be encouraging the use of smarty… we should be discouraging it.

  5. maik says:

    haha funny: “Smarty support in NetBeans || die()?” :)
    and helpful, thx.

Leave a Reply