views:

4305

answers:

4

I am looking plugin for work with Smarty in NetBeans.

I need coloring of my code and normal syntax analysys.

I could find only this plugin: Smarty Editor, but I could not make it work.

Can you tell me about another plugin for Smarty or teach me how to install SmartyEditor?

Edit: I use Windows XP SP3

+1  A: 

It worked for me, out of the box. I use NetBeans 6.7.1 and this is what I did

  1. Downloaded the plugin .nbm file from the location you mentioned
  2. Install plugin as explained here
  3. In an existing project with web stuff, File-->New File-->Other-->Empty Smarty file

This generated at .tpl file with just

{*

    Author:
    Smarty template
*}

in it. As explained on the plugin download page, outside the Smarty tags you get only basic functionality in as well php as html segments of the file, but as far as I can see the syntax coloring of php and html is OK. Code completion works fine inside Smarty tags.

Regarding syntax analysis: I created a number of errors is html and php in the tpl file and it seems to pick them up correctly.

So, while it's annoying that you loose code completion in html and php it looks quite usable and useful to me.

Let me know if these instructions solved your problem.

fvu
worked for me too on nb6.8 beta, thanks!
Alex
+1  A: 

I've used this trick before, it might help you. Linking rather than copying to give credit back to the author.

Orange Box
A: 

Hello What you have todo is to first install the smarty editor plugin then edit this file on vista : C:\Users\yourusername.netbeans\6.7\config\Services\MIMEResolver\user-defined-mime-resolver.xml

Delete everything and add the following code to the file :

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE MIME-resolver PUBLIC "-//NetBeans//DTD MIME Resolver 1.1//EN" "http://www.netbeans.org/dtds/mime-resolver-1_1.dtd"&gt;
<MIME-resolver>
    <file>
        <ext name="tpl"/>
        <resolver mime="text/x-tpl"/>
    </file>
</MIME-resolver>
streetparade
A: 

Just found this post from Google and saw that the information is now outdated.

In the most recent builds of NetBeans, there is now official support for Smarty: http://blogs.sun.com/netbeansphp/entry/initial_support_for_smarty_available

Just download the development versions of NetBeans. Then go to tools > plugins and search for the "PHP Smarty Framework" plugin and install it.

rlorenzo